Skip to content

Commit

Permalink
Updated user study to automatically filter out untested methods in cu…
Browse files Browse the repository at this point in the history
…rrent view.
  • Loading branch information
kajdreef committed Jan 23, 2021
1 parent be6a580 commit 89216a0
Showing 1 changed file with 9 additions and 27 deletions.
36 changes: 9 additions & 27 deletions src/components/routes/TestMatrixView.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
// Custom Components
import MatrixVisualization from '../visualizations/MatrixVisualization';
import FilterMenu from '../common/FilterMenu';
import FilterSlider from '../common/FilterSlider';
import Menu from '../common/Menu';
import ResultTextBox from '../common/ResultTextBox';

// Style sheets
import './TestMatrixView.scss';

// Filter functions
import { filter_by_num_method_covered, filter_by_test_passed, filter_by_coexecuted_tests, filter_by_test_type, TEST_TYPES, TEST_RESULT} from '../filters/test_filters';
import { filter_by_test_passed, filter_by_coexecuted_tests, filter_by_test_type, TEST_TYPES, TEST_RESULT} from '../filters/test_filters';
import { filter_method_by_number_of_times_tested, filter_by_coexecuted_methods } from '../filters/method_filters';
import { process_data, FunctionMap } from '../filters/data_processor';
import { sort_by_cluster_X, sort_by_cluster_Y, sort_by_coverage_X, sort_by_coverage_Y, sort_by_suspciousness} from '../filters/sorting';
Expand Down Expand Up @@ -330,6 +329,8 @@ class TestMatrixView extends Component {
const test_type = event.target.value;
let new_filter_map = new FunctionMap(current_filter_map);
new_filter_map.add_function("filter_by_test_type", filter_by_test_type, test_type)
new_filter_map.add_function("filter_method_by_number_of_times_tested",
filter_method_by_number_of_times_tested, 1)

this.setState({
history: this.state.history.concat(new_filter_map)
Expand All @@ -354,6 +355,8 @@ class TestMatrixView extends Component {
const test_result = event.target.value;
let new_filter_map = new FunctionMap(current_filter_map);
new_filter_map.add_function("filter_by_test_passed", filter_by_test_passed, test_result)
new_filter_map.add_function("filter_method_by_number_of_times_tested",
filter_method_by_number_of_times_tested, 1)

this.setState({
history: this.state.history.concat(new_filter_map)
Expand All @@ -368,24 +371,14 @@ class TestMatrixView extends Component {
const identifier = event.target.value;
let new_filter_map = new FunctionMap(current_filter_map);
new_filter_map.add_function("filter_by_coexecuted_tests", filter_by_coexecuted_tests, identifier)
new_filter_map.add_function("filter_method_by_number_of_times_tested",
filter_method_by_number_of_times_tested, 1)

this.setState({
history: this.state.history.concat(new_filter_map)
})

}} />
<FilterSlider title="Number of methods covered by test"
defaultValue={0}
min={0}
max={25}
onChange={(_, value) => {
let new_filter_map = new FunctionMap(current_filter_map);
new_filter_map.add_function("filter_by_num_method_covered", filter_by_num_method_covered, value);

this.setState({
history: this.state.history.concat(new_filter_map)
})
}} />
</AccordionDetails>
</Accordion>
<Accordion expanded={this.state.expanded === 'panel4'} onChange={handleChange('panel4')}>
Expand All @@ -404,19 +397,8 @@ class TestMatrixView extends Component {
const identifier = event.target.value;
let new_filter_map = new FunctionMap(current_filter_map);
new_filter_map.add_function("filter_by_coexecuted_methods", filter_by_coexecuted_methods, identifier)

this.setState({
history: this.state.history.concat(new_filter_map)
})
}} />
<FilterSlider
title="Number of tests covering a single method:"
defaultValue={0}
min={0}
max={25}
onChange={(_, value) => {
let new_filter_map = new FunctionMap(current_filter_map);
new_filter_map.add_function("filter_method_by_number_of_times_tested", filter_method_by_number_of_times_tested, value)
new_filter_map.add_function("filter_method_by_number_of_times_tested",
filter_method_by_number_of_times_tested, 1)

this.setState({
history: this.state.history.concat(new_filter_map)
Expand Down

0 comments on commit 89216a0

Please sign in to comment.