Software Integration IT 323 Software Engineering 2 Tutorial

  • Slides: 21
Download presentation
Software Integration IT 323 - Software Engineering 2 Tutorial

Software Integration IT 323 - Software Engineering 2 Tutorial

Example-1 Given a simple program that reads a string inverts it then writes it

Example-1 Given a simple program that reads a string inverts it then writes it • the structure of this program is Main S Read S S. inv Invert S. inv Write • Where boxes indicate modules and links indicate module calling

1. Bottom-up Integration • Bottom-up Integration Algorithm – Integrates components at the lowest levels

1. Bottom-up Integration • Bottom-up Integration Algorithm – Integrates components at the lowest levels then adds functional components when going to the upper levels.

1. Bottom-up Integration • Bottom-up Integration Algorithm 1. Construct drivers for low level modules.

1. Bottom-up Integration • Bottom-up Integration Algorithm 1. Construct drivers for low level modules. 2. Execute and test each driver separately. 3. Remove drivers and combine modules moving upward into clusters that perform a specific software subfunction. When the main module is reached go to 5) 4. Construct a driver per cluster. Go to 2) 5. Stop when the whole system structure is built and no drivers remain

1. Bottom-up Integration drivers Read Invert Step 1 Step 2 Write Step 3

1. Bottom-up Integration drivers Read Invert Step 1 Step 2 Write Step 3

1. Bottom-up Integration • Step 1 – Test the “Read” module through its driver

1. Bottom-up Integration • Step 1 – Test the “Read” module through its driver void Read(String s) { Output(“enter string”); Input(S); } void main(){ String s; Read (s); Output(“the string read is”, s) }

1. Bottom-up Integration • Step 2 – Test the “Invert” module through its driver

1. Bottom-up Integration • Step 2 – Test the “Invert” module through its driver void invert(string r, string s)) { For (i=0; i<s. length ; i++) r[i]=s[s. length-1 -i]; } void main(){ String r, s; s=”Example text”; Invert(r, s); Output(“text to be inverted” , s, ”its inverse”, r); }

1. Bottom-up Integration • Step 3 – Test the “Write” module through its driver

1. Bottom-up Integration • Step 3 – Test the “Write” module through its driver void write(string r) { Output(“inverted string is”, r); } void main(){ String r; r=”Example text”; Write(r); }

1. Bottom-up Integration • Step 4 : void Read(String S){ Output(“enter string”); Input(S); }

1. Bottom-up Integration • Step 4 : void Read(String S){ Output(“enter string”); Input(S); } void invert(string r, string s)){ For (i=0; i<s. length; i++) R[i]=S[s. length-i-1] } void write(string r){ Output(“inverted string is”, r); } void main() { String s, r; Read(s); Invert(s, r); Write(s); }

2. Top-down integration • Top-down Integration Algorithm – Develops the skeleton of the system

2. Top-down integration • Top-down Integration Algorithm – Develops the skeleton of the system and populate it with components.

2. Top-down integration

2. Top-down integration

2. Top-down integration Read

2. Top-down integration Read

2. Top-down integration Read Invert

2. Top-down integration Read Invert

2. Top-down integration Read Invert Write

2. Top-down integration Read Invert Write

2. Top-down integration • Top-down Integration Algorithm 1. Use Main control module as a

2. Top-down integration • Top-down Integration Algorithm 1. Use Main control module as a test driver and substitute all modules that are directly subordinate to it by stubs. 2. Depending on the integration approach selected (depth first or breadth first), choose a stub and replace it by a real module. 3. Tests are conducted after replacement of a stub by a real module. 4. While there exist stubs in the system, go to step 2(loop) 5. Stop when the whole system structure is built and no stubs remain.

2. Top-down integration • Step 1 void SRead(string s) % read stub %{ Output(“I

2. Top-down integration • Step 1 void SRead(string s) % read stub %{ Output(“I am in READ module”); S=”Example string”; } void SInvert(string s, string r) % invert stub %{ Output(“I am in Invert module”); Output(S); r=”Example output string”; } void Swrite(string r) % write stub %{ Output(“I am in write module”); Output(r); } void main(){ String r, s; Sread(s); Sinvert(s, r); Swrite(r); }

2. Top-down integration • Step 2 – Replacing Sread (stub of read procedure) by

2. Top-down integration • Step 2 – Replacing Sread (stub of read procedure) by its real Read and keep the rest unchanged void Read(string s){ Output(“enter string”); Input(S); } void SInvert(string s, string r) % invert stub %{ Output(“I am in Invert module”); Output(S); r=”Example output string”; } void Swrite(string r) % write stub %{ Output(“I am in write module”); Output(r); } void main(){ String r, s; Read(s); Sinvert(s, r); Swrite(r); }

2. Top-down integration • Step 3 – Replacing Sinvert and keep the rest unchanged

2. Top-down integration • Step 3 – Replacing Sinvert and keep the rest unchanged void Read(string s){ Output(“enter string”); Input(S); } void Invert(string s, string r) { For (i=0; i<s. length; i++) R[i]=S[s. length-i-1] } void Swrite(string r) % write stub %{ Output(“I am in write module”); Output(r); } void main(){ String r, s; Read(s); Invert(s, r); Swrite(r); }

2. Top-down integration • Step 4 – Replace all stubs by their real &

2. Top-down integration • Step 4 – Replace all stubs by their real & integrate the system void Read(string s){ Output(“enter string”); Input(S); } void Invert(string s, string r) { For (i=0; i<s. length; i++) R[i]=S[s. length-i-1] } void Write(string r){ Output(“inverted string is”, r); } void main(){ String r, s; Read(s); Invert(s, r); Write(r); }

Example -2 • Given the software (Structured Chart) system skeleton

Example -2 • Given the software (Structured Chart) system skeleton

Example -2 Use the above skeleton to identify the testing strategy indicated by the

Example -2 Use the above skeleton to identify the testing strategy indicated by the sequences given. • {F}; {G}; {H}; {I}; {J}; {K}; {B, F, G, H}; {E, I, J, K}; {A, B, C, D, E, F, G, H, I, J, K} – Top-down testing – Bottom-up testing – Big-bang testing • {A}; {A, B, C}; {A, B, C, D, E}; {A, B, C, D, E, F, G}; {A, B, C, D, E, F, G, H, I}; {A, B, C, D, E, F, G, H, I, J, K} – Top-down testing – Bottom-up testing – Big-bang testing