Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Imag ne that you are head of test ng department of a software house. In your department, there are several testing staff who design test
Imagne that you are head of testng department of a software house. In your department, there are several testing staff who design testcases for different software modules. A module holds some number of lines of code and each test case may cover some of the code lines of the module.
For example, let our very simple module contains lines of code ie and we have number of different test cases prepared for the testing the module. Table shows an example line numbers covered by each of different example test cases.
Table Example testcase IDs and their code line coverage information.
tableTestCase,Covered Line NumbersTTTTTT
As the head of the testing department, you wish to minimize the number of applied test cases per
module in order to save testing time. On the other hand, the selected minimum number of test
cases among alternatives are required to cover all the lines of module under test together in
order to not to risk some of the module lines not being tested. In other words, the selected
minimum number of test cases should cover all the code lines of the module collectively. For
example for the above problem instance, you have to select the test cases and that covers all the module lines together. In your solution, assume that each line of the module under test
is covered by at least one test case.
In order to solve the problem, you decide to develop a software tool that uses Transform &
Conquer algorithm design technique. According to the approach, first you need to convert given
problem instance into an Integer Linear Programming ILP problem then solve the constructed ILP
problem by using a backend solver namely IBMCplex Solver on the fly. Finally, display the
obtained result in a meaningful way. See Figure below.
Figure A simple architectural view for your test case selection software.
SAMPLE INPUT:
Number of lines of code of the module
Number of test cases
Covered lines by test case number #
Covered lines by test case number #
Covered lines by test case number #
Covered lines by test case number #
Covered lines by test case number #
Covered lines by test case number #
SAMPLE OUTPUT:
IDs of the minimum number of selected test cases that covers all the module lines:
question part
Assume that we modify the above test case selection problem by introducing a cost value associated with each test case. Our new goal is to decide on minimum total cost subset that still covers all the module statements. This time, you are required to propose and implement an efficient greedy algorithm that solves the modified problem directly without any transformation as above.
Your bonus submission should include the following pieces:
i A report that explains your greedy choicestrategy Also, line by line cost analysis of your algorithm and its measured time complexity.
ii Source code of your greedy algorithm implementation.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started