An example of a Test Plan You should include tests for: · all conditions of normal use · fielded error conditions (those that are reported by the program and program continues) · fatal error...

1 answer below »

Exercise 10:(3) ModifyMusic5.javaby adding aPlayableinterface. Move theplay( )declaration fromInstrumenttoPlayable. AddPlayableto the derived classes by including it in theimplementslist. Changetune( )so that it takes aPlayableinstead of anInstrument.


An example of a Test Plan You should include tests for: · all conditions of normal use · fielded error conditions (those that are reported by the program and program continues) · fatal error conditions (those that cause the program to stop) Please keep test plans as separate documents rather than as inline code. This is an example a test plan for Program 2 TME1. It is not necessarily complete or the only way you can lay this out. It illustrates one way to show how you will test a program, why, and the expected results. Testing normal conditions > java SubString qwerty 2 3 resulting string is: ert > java SubString qwerty 0 1 resulting string is: q > java SubString qwerty 0 6 resulting string is: qwerty Testing error conditions in the two arguments > java SubString qwerty 1 8 resulting string is: error - arguments out of range > java SubString qwerty -1 3 resulting string is: error - arguments out of range > java SubString qwerty 0 g resulting string is: error - arguments non numeric Testing error conditions with insufficient arguments > java SubString insufficient arguments please use SubString > java SubString qwerty insufficient arguments please use SubString > java SubString qwerty 2 insufficient arguments please use SubString If you have no input but use built in tests these should also cover all possible conditions and indicate the purpose of the tests in the output to the console. If you are testing a GUI program you should also include details of the tests you have done - and why, indicating the sequence of events and maybe a screen print of the result. Testplans_an_example.doc updates 24/03/01 package omay.tij.ch_10_interfaces.ex10; /*Modify Music5.java by adding a Playable interface. Move the play() declaration from Instrument to Playable. Add Playable to the derived classes by including it in the implements list. Change tune()so that it takes a Playable instead of an Instrument . */ import omay.tij.ch_9_polymorphism.ex6.music.Note; interface Playable { void play(Note n); } interface Instrument { void adjust(); } class Wind implements Instrument, Playable { public void play(Note n) { System.out.println(this + ".play()" + n); } public String toString() { return "Wind"; } public void adjust() { System.out.println(this + " .adjust()"); } } class Percussion implements Instrument, Playable { public void play(Note n) { System.out.println(this + ".play()" + n); } public String toString() { return "Percussion"; } public void adjust() { System.out.println(this + " .adjust()"); } } class Stringed implements Instrument, Playable { public void play(Note n) { System.out.println(this + ".play()" + n); } public String toString() { return "Stringed"; } public void adjust() { System.out.println(this + ".adjust()"); } } class Brass extends Wind { public String toString() { return "Brass"; } } class Woodwind extends Wind { public String toString() { return "Woodwind"; } } public class Music5 { static void tune(Playable p) { p.play(Note.MIDDLE_C); } static void tuneAll(Playable[] e) { for (Playable p : e) tune(p); } public static void main(String[] args) { Playable[] orchestra = {new Wind(), new Percussion(), new Stringed(), new Brass(), new Woodwind()}; tuneAll(orchestra); } }
Answered 5 days AfterFeb 14, 2022

Answer To: An example of a Test Plan You should include tests for: · all conditions of normal use · fielded...

Shweta answered on Feb 19 2022
107 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here