Question
We have 2 files: 1.Universe.txt - The test cases are specified in the file universe.txt (one test case per line). 2.RandomBranchCoverage.txt - contains information about
We have 2 files:
1.Universe.txt - The test cases are specified in the file "universe.txt" (one test case per line).
2.RandomBranchCoverage.txt - contains information about line number, line coverage, branch coverage.For Example
"387": {"line_coverage": 98.46, "branch_coverage": 100.0}
Write a python program that will replace line number in RandomBranchCoverage.txt with test case present at that line number in universe.txt file.
For example :
Output for "387" : {"line_coverage": 98.46, "branch_coverage": 100.0} should be 65 0 1 300 700 424 1 600 500 0 0 0
Contents of Universe.txt file are in this format :
1258 1 0 897 174 7253 1 629 500 0 0 1 867 1 1 1774 101 2204 0 499 499 1 0 1 775 1 1 942 311 1504 1 540 500 1 0 1 1206 1 0 5140 355 730 2 980 693 2 2 0 675 1 0 300 599 424 2 700 640 1 0 1 700 1 1 400 300 600 2 100 500 0 1 1 906 0 0 4284 439 111 2 740 740 0 1 1 798 1 1 2071 49 307 0 849 904 1 2 0 1078 1 1 581 567 655 0 1 1 799 0 1 5588 485 211 0 399 499 0 0 1 934 1 1 233 500 335 0 845 400 0 1 1 907 1 0 560 342 601 3 961 399 2 2 1 830 1 0 -1 473 631 3 22 0 0 2 1 709 1 1 686 483 672 1 465 475 1 2 1 698 1 0 3071 59 307 0 849 904 0 2 0 901 1 1 502 200 503 0 401 400 0 1 1 652 1 0 -100 478 779 0 356 371 -1 2 0 901 1 1 502 200 503 0 401 400 0 1 0 718 1 0 717 34 1153 2 429 326 0 0 1 718 1 0 717 34 1153 2 429 326 0 0 0
Contents of RandomBranchCoverage.txt file are in this format :
387: {"line_coverage": 98.46, "branch_coverage": 100.0} 1473: {"line_coverage": 98.46, "branch_coverage": 100.0} 543: {"line_coverage": 98.46, "branch_coverage": 100.0} 432: {"line_coverage": 98.46, "branch_coverage": 100.0} 442: {"line_coverage": 98.46, "branch_coverage": 100.0} 1439: {"line_coverage": 98.46, "branch_coverage": 100.0} 1014: {"line_coverage": 98.46, "branch_coverage": 100.0} 19: {"line_coverage": 98.46, "branch_coverage": 100.0} 421: {"line_coverage": 98.46, "branch_coverage": 100.0} 1471: {"line_coverage": 98.46, "branch_coverage": 100.0} 681: {"line_coverage": 98.46, "branch_coverage": 100.0} 1236: {"line_coverage": 98.46, "branch_coverage": 100.0} 693: {"line_coverage": 98.46, "branch_coverage": 100.0} 390: {"line_coverage": 98.46, "branch_coverage": 100.0} 1434: {"line_coverage": 98.46, "branch_coverage": 100.0} 96: {"line_coverage": 98.46, "branch_coverage": 100.0} 1134: {"line_coverage": 98.46, "branch_coverage": 100.0} 205: {"line_coverage": 98.46, "branch_coverage": 100.0} 454: {"line_coverage": 98.46, "branch_coverage": 100.0} 666: {"line_coverage": 98.46, "branch_coverage": 100.0}
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