For each of the source code fragments below 1) Construct the basis set, that is, a set of the required number of indepen

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

For each of the source code fragments below 1) Construct the basis set, that is, a set of the required number of indepen

Post by answerhappygod »

For each of the source code fragments below 1) Construct thebasis set, that is, a set of the required number of independentpaths through the source code fragment. 2) Construct a pathpredicate for each independent path. Note: - Refine the codefragment/program graph if there are any decisions comprisingcompound conditions. - Use line numbers to describe the independentpaths. - Use Boolean conditions from the source code to describethe path predicates.
1.
Problem a:
void Q1(){S1;if(C1){S2;}S3;if(C2 OR C3){S4;}else{S5;}S6;}
Problem b:
void Q2(){if(C1&&C2){S1;}else{if(C3){S2;}else{S3;}while(C4){S4;}S5;}}
Problem c:
void Q1(){for(S1;C1;S2){while(C2 && C3){if(C4){S3;}else{if(C5){S4;}}}}S5;}
Problem d:
void Q1(){if(C1){S1;while(C2){if(C3){S2;S3;}}}else{S4;while(C4){S5;while(C5){S6;}S7;}}}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply