Software Integration

21
Software Integration IT323 - Software Engineering 2 Tutorial

description

Software Integration. IT323 - Software Engineering 2 Tutorial. Main. S. S. S.inv. S.inv. Read. Invert. Write. Example-1. Given a simple program that reads a string inverts it then writes it the structure of this program is - PowerPoint PPT Presentation

Transcript of Software Integration

Page 1: Software Integration

Software Integration

IT323 - Software Engineering 2Tutorial

Page 2: Software Integration

Example-1

Given a simple program that reads a string inverts it then writes it • the structure of this program is

• Where boxes indicate modules and links indicate module calling

Main

Read Invert Write

SS S.inv S.inv

Page 3: Software Integration

1. Bottom-up Integration

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

adds functional components when going to the upper levels.

Page 4: Software Integration

1. Bottom-up Integration

• Bottom-up Integration Algorithm1. 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

Page 5: Software Integration

1. Bottom-up Integration

Read Invert Write

Step 1 Step 2 Step 3

drivers

Page 6: Software Integration

1. Bottom-up Integration

• Step1– 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)

}

Page 7: Software Integration

1. Bottom-up Integration

• Step2– 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);

}

Page 8: Software Integration

1. Bottom-up Integration

• Step3– 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);

}

Page 9: Software Integration

1. Bottom-up Integration

• Step4 : void Read(String S){Output(“enter string”);Input(S);

}void invert(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);

}

Page 10: Software Integration

2. Top-down integration

• Top-down Integration Algorithm– Develops the skeleton of the system and populate

it with components.

Page 11: Software Integration

2. Top-down integration

Page 12: Software Integration

2. Top-down integration

Read

Page 13: Software Integration

2. Top-down integration

Read Invert

Page 14: Software Integration

2. Top-down integration

Read Invert Write

Page 15: Software Integration

2. Top-down integration• Top-down Integration Algorithm1. 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.

Page 16: Software Integration

2. Top-down integration

• Step1void 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);}

Page 17: Software Integration

2. Top-down integration

• Step2– 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);}

Page 18: Software Integration

2. Top-down integration

• Step3– 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);}

Page 19: Software Integration

2. Top-down integration

• Step4– 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);}

Page 20: Software Integration

Example -2

• Given the software system skeleton (Structured Chart)

Page 21: Software Integration

Example -2Use 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};{A,B,C}; {A,B,C,D};{A,B,C,D,E};{A,B,C,D,E,F};{A,B,C,D,E,F,G};{A,B,C,D,E,F,G,H}; {A,B,C,D,E,F,G,H,I}; {A,B,C,D,E,F,G,H,I,J}; {A,B,C,D,E,F,G,H,I,J,K}– Top-down testing– Bottom-up testing– Big-bang testing