220 likes | 321 Views
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
E N D
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 • Where boxes indicate modules and links indicate module calling
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 • Construct drivers for low level modules. • Execute and test each driver separately. • Remove drivers and combine modules moving upward into clusters that perform a specific software subfunction. When the main module is reached go to 5) • Construct a driver per cluster. Go to 2) • Stop when the whole system structure is built and no drivers remain
Read Invert Write Step 3 Step 2 Step 1 1. Bottom-up Integration drivers
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) • }
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); • }
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); • }
1. Bottom-up Integration • 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); • } • Step4 :
2. Top-down integration • Top-down Integration Algorithm • Develops the skeleton of the system and populate it with components.
Read 2. Top-down integration
Read Invert 2. Top-down integration
Read Invert Write 2. Top-down integration
2. Top-down integration • Top-down Integration Algorithm • Use Main control module as a test driver and substitute all modules that are directly subordinate to it by stubs. • Depending on the integration approach selected (depth first or breadth first), choose a stub and replace it by a real module. • Tests are conducted after replacement of a stub by a real module. • While there exist stubs in the system, go to step 2(loop) • Stop when the whole system structure is built and no stubs remain.
2. Top-down integration 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); } • Step1
2. Top-down integration • 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); • } • Step2 • Replacing Sread(stub of read procedure) by its real Read and keep the rest unchanged
2. Top-down integration • 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); • } • Step3 • Replacing Sinvert and keep the rest unchanged
2. Top-down integration • 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); • } • Step4 • Replace all stubs by their real & integrate the system
Example -2 • Given the software system skeleton (Structured Chart)
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};{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