1. Considerthefollowingmethodthatreturnsthe grade for a given score…. 1 answer below »

1. Considerthefollowingmethodthatreturnsthe grade for a given score….
1 answer below » SOFTWARETESTING Final EXERCISE Sumbit time:May 16.2022 1. Considerthefollowingmethodthatreturnsthe grade for a given score. public string get_grade(int score) { string grade = “”; if (score >=0 &&score grade = “E”; } else if (score >=10 && score grade = “D”; } else if (score >=20 && score grade = “C”; } else if (score >=30 && score grade = “B”; } else if (score >=40) { grade = “A”; } return grade; } (a) Draw thecontrol?owgraph for thegetgrademethod. Labeleachofthe edges in thecontrol?owgraphwithanumberandeachoftheblockswith aletter. (b) Writetestswithinputandexpectedoutputforthismethod. Usingthe labelsontheedgesinthe?owgraph, writedownthe sequenceofedges traversedbyeachofthetests. (c) Evaluate the fractionofedgescoveredbythetests (Covered/Total).Ifany edgesareuncovered, writeadditionalteststocoverthem. (d) Supposethedeveloperhasincorrectlywrittenthe conditionwithllinstead of&& inthe?rst if statementasif score >=0 ll score answer. (e) Whichcoveragecriteriaisbothpracticaland rigorousfortestingcomplex boolean expressions? For the expression ((x1 && y1) ll z1), develop tests thatachieve thiscoveragecriteria. Assumex1, y1, z1areallinput booleanvariables. Eachofyourtestsshouldassignvaluestotheseinput booleanvariablesandevaluate theexpression. (f) Forthefindmaximummethodgivenbelow (nisnumberofelementsin parametera[]), write testswithinputandexpectedoutputthatachieves “AllDUpairs”coverageforvariablesc, maxandindex. Writeoutthe pairsusing thelinenumbersshownbelowforthethreevariables andshowcoverageachieved. 1 int find_maximum(int a[], intn) { 2 int c, max, index; 3 4 max = a[0]; 5 index = 0; 6 7 for (c = 1; 8 c 9 c++) { 10 if (a[c] >max) { 11 index = c; 12 max = a[c]; 13 } 14 } 15 16 return index; 17 } 2. You have toconduct functionaltestingofadialogwiththreesetsofradiobuttons on it, representing travel needs within UK. The ?rst set of radiobuttonsspeci?es adestination, bycountrywithinUK—England, Scotland, Wales, orNorthern Ireland; thesecondnotes thechoiceofanaisleorwindowseat; andthethird affordsthechoiceofcoach, business, or economyclass.Whentheusermakesher selectionsandpresses ”OK” toclose thedialog, theapplicationwilltakeona different path of execution for each combination of given options in given states. (a) Howmanytestsdoyouneedtotestallpossiblecombinationsofinputchoices inthedialog? (b) Which functionaltestingtechniquewill you applyto bring downthe number ofcombinationsandwhy? (c) Apply this functional testing technique to thegivenproblemandshowthe resultingtestsuite (d) Giveanexampleofacombinationofinputs thatyour testsuitewillmiss andstatewhy.(5marks) (e) Givenaspeci?cation: a function that takesasinputanintegerinp1, and returnshalf thevalueof inp1 if inp1 iseven, and inp1otherwise. Forthis function speci?cation,identify representative value classes for the input inp1 withabriefexplanation. 3. (a) For theclassdiagraminFigure1, draw theuse/includerelationtorepre- sentpotentialinteractionsbetweenclassestobeveri?ed throughinter-class testing. Figure1: Classdiagramfor an elevator (b) Imagineagrandmotherwhowillonlyapproveyoudatinghergrandchildif youareolderthan25andyoungerthan40 and eitherrich orreally smart. If thatgrandmotherwasaprogrammerandcouldconvinceapplicantsto answerhonestly, herprogrammightlookabitlikethis: ShallowGrandmother.java 1 import java.util.Scanner; 2 3 public class ShallowGrandmother { 4 public static voidmain( String[] args ) { 5 Scanner keyboard = new Scanner(System.in); 6 int age; 7 doubleincome, smart; 8 boolean allowed; 9 10 System.out.print( “Enter your age: ” ); 11 age = keyboard.nextInt(); 12 13 System.out.print( “Enter your yearly income: ” ); 14 income = keyboard.nextDouble(); 15 16 System.out.print( “How smart are you, on a scale from 0.0 to 10.0? ” ); 17 smart = keyboard.nextDouble(); 18 19 allowed = ( age > 25 && age < 40 && ( income > 50000 || smart >= 8.5 ) ); 20 21 System.out.println( “Allowed to datemy grandchild? ” + allowed ); 22 } 23 } Inputs to theprogramare’age’, ’income’, ’How smart are you?’, and outputistheboolean’allowed’. i.For theShallowGrandmother class above, derive 6mutationsthat per- formexpression/operandmodi?cations.Lines in the method above are shownwith thelinenumber.Toshoweachmutation, simply statethe linenumberbeingmutatedandshow thelinewiththemodi?cation. ii.Derive tests that reveal thesemodi?cations(oneatatime, assuming eachmutation resultsina new program). Please show expected and actual output for each of the tests. iii.Do the testsrevealingthemutationsachieve condition coverageofthe code,showyour answer. If they do not achieve condition coverage,add tests for fullconditioncoverage. (c) Assumeyouhave1000regressiontestsandyourresourcesonlyallowyouto run200ofthem. Howwill you choosetheregressionteststorunwiththe limited resources?Discussthedi?erentwaysofchoosing regressiontests. May 16 2022 04:08 PM

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 (409) 205-8984

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 30% with the discount code DISCOUNT