Software Architecture
             Software Architectural Test Case Writing




2009.11.08                                                    Sitdhibong Laokok
                                                        goto.champ@gmail.com
Agenda

• Software Development Methodology
• Software Testing
• Architectural Test Case Writing
Agenda

• Software Development Methodology
• Software Testing
• Architectural Test Case Writing
Software Dev. Methodology



• Waterfall Model
• Iterative and Incremental Model
Waterfall
Requirements

      Design

       Implementation

               Verification

                   Maintenance
Iterative and Incremental

                              System Analysis                       Coding



                                              Architecture Design

                                                                             TEST
Business     Critical Requirement
 Goal                                     Test Case Design



                                Requirement
Vilfredo Pareto
   Italian economist
    (1848 - 1923)
20

80
100

      20%
 75


                80%
 50

      80%
 25


                20%
  0
      Actions   Results
Iterative and Incremental

                              System Analysis                       Coding



                                              Architecture Design

                                                                             TEST
Business     Critical Requirement
 Goal                                     Test Case Design



                                Requirement
Business Goals




                                        System Feature




                                  Function Requirement




                                             Test Case


Comes from Critical Requirement
Agenda

• Software Development Methodology
• Software Testing
• Architectural Test Case Writing
Test Plan : “SPACEDIRT”
•   Scope         •   Incidentals

•   People        •   Risks

•   Approach      •   Tasks

•   Criteria

•   Environment

•   Deliverable
Goals

• To improve quality
• For reliability estimation
• For Verification and Validation (V&V)
Verification & Validation
• Functionality   • Engineering       • Adaptability
  • Correctness     • Efficiency         • Flexibility
  • Reliability     • Testability       • Reusability
  • Usability       • Documentation     • Maintainability
                    • Structure
Software Dimension




W3C Semantic Web Logo - http://www.w3.org/2007/10/sw-logos.html
Software Dimension
                                                                  Usability



                                Quality                                       Functionality


                                                                  Security



W3C Semantic Web Logo - http://www.w3.org/2007/10/sw-logos.html
Software Testing

• Unit Test
• Functional Test
• Reliability Test
• Performance Test
• Architectural Test
Functional & Non-Functional

                    Functionality
      Enter PIN no., Select account type, Choose
      or Enter Amount, Receive money


                  Non-Functionality
         Verify PIN no. with bank, Check total
       amount in machine, Check user’s account
                balance, Error Handling
Quality Attributes*
        • Availability
        • Modifiability
        • Performance
        • Security
        • Traceability
        • Usability
*Or Non-Functionality Requirement
Quality Attribute Scenarios
 •   Source of stimulus                   •   Artifact

 •   Stimulus                             •   Response

 •   Environment                          •   Response measure




                                Artifact
                     Stimulus                  Response
                                Environment
Source of stimulus                                        Response measure
Artifact
                     Stimulus                       Response
                                  Environment
Source of Stimulus                                             Response measure


  Source of
   Stimulus    Developer

   Stimulus    Wishes to change the UI

   Artifact    Code

 Environment   At design time

  Response     Modification is made with no side effect
  Response
  measure      In 3 hours
In the case of developer want to change UI Design
Vision                                       Vision

                                                                                        Business Goals
                              BG1               BG2                 BG3
                                                                                        System Feature

            SF1               SF2                SF3                SF4             SF5

                                                                                            Function
                                                                                          Requirement
             FR2                    FR4
                                                 FR6          FR8
      FR1               FR3                                               FR9       FR10
                                      FR5                FR7

                  TC4         TC6
                                                TC9            TC12       TC13
TC1         TC3                                                                               TC16
                        TC5         TC7
                                                             TC11
      TC2                                 TC8         TC10                       TC14       Test Case
Software Engineering – Dr Ghazy Assassa                                                        Page 2 of 5


                                                Test Case Template (Doc:T_01)

    Test Case #:                                                     Test Case Name:                    Page: 1 of ..
    System:                                                           Subsystem:
    Designed by:                                                      Design Date:
    Executed by:                                                      Execution Date:
    Short Description:



      Pre-conditions




    Step Action                                 Expected System Response                Pass/ Comment
                                                                                        Fail
     1
     2




      Post-conditions




http://faculty.ksu.edu.sa/ghazy/CSC342_Tools/Test%20Case%20Template.pdf
Software Engineering – Dr Ghazy Assassa                                                                           Page 3 of 5

                                               Test Case Example1 (simple test)

    Test Case #: 2.2                                                 Test Case Name: Change PIN                         Page: 1 of 1
    System: ATM                                                       Subsystem: PIN
    Designed by: ABC                                                  Design Date: 28/11/2004
    Executed by:                                                      Execution Date:
    Short Description: Test the ATM Change PIN service

      Pre-conditions
      The user has a valid ATM card - The user has accessed the ATM by placing his ATM card in the machine
      The current PIN is 1234
      The system displays the main menu

    Step Action                              Expected System Response                                              Pass/ Comment
                                                                                                                   Fail
     1     Click the 'Change PIN' button     The system displays a message asking the user to enter the new PIN
     2     Enter '5555'                      The system displays a message asking the user to confirm (re-enter)
                                             the new PIN
     3     Re-enter '5555'                   The system displays a message of successful operation
                                             The system asks the user if he wants to perform other operations
     4     Click 'YES' button                The system displays the main menu
     5     Check post-condition 1

      Post-conditions
      1. The new PIN '5555' is saved in the database




http://faculty.ksu.edu.sa/ghazy/CSC342_Tools/Test%20Case%20Template.pdf
Vision

Business Goals


System Feature




    Function
  Requirement




    Test Case
Agenda

• Software Development Methodology
• Software Testing
• Architectural Test Case Writing
Architecture Design is Shaped by KPIs

                   KPI #1




   KPI #3                               KPI #2


             Developer
                         Architecture




                   KPI #4
Artifact
                     Stimulus                       Response
                                  Environment
Source of Stimulus                                             Response measure


  Source of
   Stimulus    Developer

   Stimulus    Wishes to change the UI

   Artifact    Code

 Environment   At design time

  Response     Modification is made with no side effect
  Response
  measure      In 3 hours
In the case of developer want to change UI Design
Architecture Design is Shaped by KPIs

  KPI #1: Developer have to change UI within 3 hours at design time




    KPI #3                                               KPI #2


                       Developer
                                     Architecture




                               KPI #4
System Qualities
• Availability    • Reliability
• Modifiability    • Interoperability
• Usability       • Integrability
• Performance     • Supportability
• Security        • Customizability
• Testability     • Safety
• Scalability     • Maintainability
• Extensibility
Test Case Elements
                  Approaches

         Name                  Objective




Expected Output                Test Scripts
 and Outcome
                    Input
Sample Scenario
            Scenario refinement for Scenario:

            Scenario(s):

            Business Goals:

            Relevant Quantity Attribute(s):

                                      Stimulus:
                Scenario Components




                                      Source of Stimulus:

                                      Environment:

                                      Artifact:

                                      Response:

                                      Response Measure:

            Questions:

            Issues:



Narong Chansoi, “Software Architecture Test Case Writing”
Artifact
                     Stimulus                       Response
                                  Environment
Source of Stimulus                                             Response measure


  Source of
   Stimulus    Developer

   Stimulus    Wishes to change the UI

   Artifact    Code

 Environment   At design time

  Response     Modification is made with no side effect
  Response
  measure      In 3 hours
In the case of developer want to change UI Design
Sample Scenario
            Scenario refinement for Scenario: PR1-SCE1-CHANGEUI

            Scenario(s): Developer want to change UI at design time

            Business Goals:

            Relevant Quantity Attribute(s): Maintainability

                                      Stimulus:             Wishes to change the UI
                Scenario Components




                                      Source of Stimulus:   Developer

                                      Environment:          At design time

                                      Artifact:             Code

                                      Response:             Modification made no side effect

                                      Response Measure:     In 3 hours

            Questions: Developer change the UI in test server before deploy to production server?

            Issues:



Narong Chansoi, “Software Architecture Test Case Writing”
Software Engineering – Dr Ghazy Assassa                                                                           Page 3 of 5

                                               Test Case Example1 (simple test)

    Test Case #: 2.2                                                 Test Case Name: Change PIN                         Page: 1 of 1
    System: ATM                                                       Subsystem: PIN
    Designed by: ABC                                                  Design Date: 28/11/2004




                                                                          e
    Executed by:                                                      Execution Date:
    Short Description: Test the ATM Change PIN service




                                             pl
      Pre-conditions
      The user has a valid ATM card - The user has accessed the ATM by placing his ATM card in the machine
      The current PIN is 1234




                                           am
      The system displays the main menu

    Step Action                              Expected System Response                                              Pass/ Comment
                                                                                                                   Fail
     1     Click the 'Change PIN' button     The system displays a message asking the user to enter the new PIN
     2     Enter '5555'                      The system displays a message asking the user to confirm (re-enter)
                                             the new PIN
                         Ex
     3     Re-enter '5555'                   The system displays a message of successful operation
                                             The system asks the user if he wants to perform other operations
     4     Click 'YES' button                The system displays the main menu
     5     Check post-condition 1

      Post-conditions
      1. The new PIN '5555' is saved in the database




http://faculty.ksu.edu.sa/ghazy/CSC342_Tools/Test%20Case%20Template.pdf
References
•   Narong Chansoi: “Software Architectural Test Case Writing”

•   Dr.Varanyu, “80-20” http://varanyu.blogspot.com/2008/10/8020.html

•   “List of Quality Attribute” - http://en.wikipedia.org/wiki/List_of_system_quality_attributes

•   Donald Graham, “Quality Attribute Scenarios”, http://www.spin.org.za/spin21/SPIN%2021%20-
    %20QAS.pdf

•   Christoph Stoermer, “Moving Towards Quality Attribute Driven Software Architecture Reconstruction”,
    http://www.cs.vu.nl/~x/square/qadsar.pdf

•   Ed, “Patterns & Practices Test : Architecture Testing”, http://blogs.msdn.com/pagtest/archive/
    2005/03/18/398678.aspx

•   Louis Marshall, “Project Management for the Web: Quality Test Plan”, http://pm4web.blogspot.com/
    2008/07/quality-test-plan.html

•   Dr Ghazy Assassa, “Software Engineering: Test Case Template and Example”, http://faculty.ksu.edu.sa/ghazy/
    CSC342_Tools/Test%20Case%20Template.pdf

•   GSA, “FIPS 201 Evaliation Program - Template Generator Test Procedure”, http://fips201ep.cio.gov/
    documents/Template%20Generator_Test%20Procedure_v2.0.0.pdf
References
•   QA Plan, “Test Suite”, http://readyset.tigris.org/nonav/templates/test-suite.html

Software Architecture: Test Case Writing

  • 1.
    Software Architecture Software Architectural Test Case Writing 2009.11.08 Sitdhibong Laokok goto.champ@gmail.com
  • 2.
    Agenda • Software DevelopmentMethodology • Software Testing • Architectural Test Case Writing
  • 3.
    Agenda • Software DevelopmentMethodology • Software Testing • Architectural Test Case Writing
  • 4.
    Software Dev. Methodology •Waterfall Model • Iterative and Incremental Model
  • 5.
    Waterfall Requirements Design Implementation Verification Maintenance
  • 6.
    Iterative and Incremental System Analysis Coding Architecture Design TEST Business Critical Requirement Goal Test Case Design Requirement
  • 7.
    Vilfredo Pareto Italian economist (1848 - 1923)
  • 8.
  • 9.
    100 20% 75 80% 50 80% 25 20% 0 Actions Results
  • 10.
    Iterative and Incremental System Analysis Coding Architecture Design TEST Business Critical Requirement Goal Test Case Design Requirement
  • 11.
    Business Goals System Feature Function Requirement Test Case Comes from Critical Requirement
  • 12.
    Agenda • Software DevelopmentMethodology • Software Testing • Architectural Test Case Writing
  • 13.
    Test Plan :“SPACEDIRT” • Scope • Incidentals • People • Risks • Approach • Tasks • Criteria • Environment • Deliverable
  • 14.
    Goals • To improvequality • For reliability estimation • For Verification and Validation (V&V)
  • 15.
    Verification & Validation •Functionality • Engineering • Adaptability • Correctness • Efficiency • Flexibility • Reliability • Testability • Reusability • Usability • Documentation • Maintainability • Structure
  • 16.
    Software Dimension W3C SemanticWeb Logo - http://www.w3.org/2007/10/sw-logos.html
  • 17.
    Software Dimension Usability Quality Functionality Security W3C Semantic Web Logo - http://www.w3.org/2007/10/sw-logos.html
  • 18.
    Software Testing • UnitTest • Functional Test • Reliability Test • Performance Test • Architectural Test
  • 19.
    Functional & Non-Functional Functionality Enter PIN no., Select account type, Choose or Enter Amount, Receive money Non-Functionality Verify PIN no. with bank, Check total amount in machine, Check user’s account balance, Error Handling
  • 20.
    Quality Attributes* • Availability • Modifiability • Performance • Security • Traceability • Usability *Or Non-Functionality Requirement
  • 21.
    Quality Attribute Scenarios • Source of stimulus • Artifact • Stimulus • Response • Environment • Response measure Artifact Stimulus Response Environment Source of stimulus Response measure
  • 22.
    Artifact Stimulus Response Environment Source of Stimulus Response measure Source of Stimulus Developer Stimulus Wishes to change the UI Artifact Code Environment At design time Response Modification is made with no side effect Response measure In 3 hours In the case of developer want to change UI Design
  • 23.
    Vision Vision Business Goals BG1 BG2 BG3 System Feature SF1 SF2 SF3 SF4 SF5 Function Requirement FR2 FR4 FR6 FR8 FR1 FR3 FR9 FR10 FR5 FR7 TC4 TC6 TC9 TC12 TC13 TC1 TC3 TC16 TC5 TC7 TC11 TC2 TC8 TC10 TC14 Test Case
  • 24.
    Software Engineering –Dr Ghazy Assassa Page 2 of 5 Test Case Template (Doc:T_01) Test Case #: Test Case Name: Page: 1 of .. System: Subsystem: Designed by: Design Date: Executed by: Execution Date: Short Description: Pre-conditions Step Action Expected System Response Pass/ Comment Fail 1 2 Post-conditions http://faculty.ksu.edu.sa/ghazy/CSC342_Tools/Test%20Case%20Template.pdf
  • 25.
    Software Engineering –Dr Ghazy Assassa Page 3 of 5 Test Case Example1 (simple test) Test Case #: 2.2 Test Case Name: Change PIN Page: 1 of 1 System: ATM Subsystem: PIN Designed by: ABC Design Date: 28/11/2004 Executed by: Execution Date: Short Description: Test the ATM Change PIN service Pre-conditions The user has a valid ATM card - The user has accessed the ATM by placing his ATM card in the machine The current PIN is 1234 The system displays the main menu Step Action Expected System Response Pass/ Comment Fail 1 Click the 'Change PIN' button The system displays a message asking the user to enter the new PIN 2 Enter '5555' The system displays a message asking the user to confirm (re-enter) the new PIN 3 Re-enter '5555' The system displays a message of successful operation The system asks the user if he wants to perform other operations 4 Click 'YES' button The system displays the main menu 5 Check post-condition 1 Post-conditions 1. The new PIN '5555' is saved in the database http://faculty.ksu.edu.sa/ghazy/CSC342_Tools/Test%20Case%20Template.pdf
  • 26.
    Vision Business Goals System Feature Function Requirement Test Case
  • 27.
    Agenda • Software DevelopmentMethodology • Software Testing • Architectural Test Case Writing
  • 28.
    Architecture Design isShaped by KPIs KPI #1 KPI #3 KPI #2 Developer Architecture KPI #4
  • 29.
    Artifact Stimulus Response Environment Source of Stimulus Response measure Source of Stimulus Developer Stimulus Wishes to change the UI Artifact Code Environment At design time Response Modification is made with no side effect Response measure In 3 hours In the case of developer want to change UI Design
  • 30.
    Architecture Design isShaped by KPIs KPI #1: Developer have to change UI within 3 hours at design time KPI #3 KPI #2 Developer Architecture KPI #4
  • 31.
    System Qualities • Availability • Reliability • Modifiability • Interoperability • Usability • Integrability • Performance • Supportability • Security • Customizability • Testability • Safety • Scalability • Maintainability • Extensibility
  • 32.
    Test Case Elements Approaches Name Objective Expected Output Test Scripts and Outcome Input
  • 33.
    Sample Scenario Scenario refinement for Scenario: Scenario(s): Business Goals: Relevant Quantity Attribute(s): Stimulus: Scenario Components Source of Stimulus: Environment: Artifact: Response: Response Measure: Questions: Issues: Narong Chansoi, “Software Architecture Test Case Writing”
  • 34.
    Artifact Stimulus Response Environment Source of Stimulus Response measure Source of Stimulus Developer Stimulus Wishes to change the UI Artifact Code Environment At design time Response Modification is made with no side effect Response measure In 3 hours In the case of developer want to change UI Design
  • 35.
    Sample Scenario Scenario refinement for Scenario: PR1-SCE1-CHANGEUI Scenario(s): Developer want to change UI at design time Business Goals: Relevant Quantity Attribute(s): Maintainability Stimulus: Wishes to change the UI Scenario Components Source of Stimulus: Developer Environment: At design time Artifact: Code Response: Modification made no side effect Response Measure: In 3 hours Questions: Developer change the UI in test server before deploy to production server? Issues: Narong Chansoi, “Software Architecture Test Case Writing”
  • 36.
    Software Engineering –Dr Ghazy Assassa Page 3 of 5 Test Case Example1 (simple test) Test Case #: 2.2 Test Case Name: Change PIN Page: 1 of 1 System: ATM Subsystem: PIN Designed by: ABC Design Date: 28/11/2004 e Executed by: Execution Date: Short Description: Test the ATM Change PIN service pl Pre-conditions The user has a valid ATM card - The user has accessed the ATM by placing his ATM card in the machine The current PIN is 1234 am The system displays the main menu Step Action Expected System Response Pass/ Comment Fail 1 Click the 'Change PIN' button The system displays a message asking the user to enter the new PIN 2 Enter '5555' The system displays a message asking the user to confirm (re-enter) the new PIN Ex 3 Re-enter '5555' The system displays a message of successful operation The system asks the user if he wants to perform other operations 4 Click 'YES' button The system displays the main menu 5 Check post-condition 1 Post-conditions 1. The new PIN '5555' is saved in the database http://faculty.ksu.edu.sa/ghazy/CSC342_Tools/Test%20Case%20Template.pdf
  • 37.
    References • Narong Chansoi: “Software Architectural Test Case Writing” • Dr.Varanyu, “80-20” http://varanyu.blogspot.com/2008/10/8020.html • “List of Quality Attribute” - http://en.wikipedia.org/wiki/List_of_system_quality_attributes • Donald Graham, “Quality Attribute Scenarios”, http://www.spin.org.za/spin21/SPIN%2021%20- %20QAS.pdf • Christoph Stoermer, “Moving Towards Quality Attribute Driven Software Architecture Reconstruction”, http://www.cs.vu.nl/~x/square/qadsar.pdf • Ed, “Patterns & Practices Test : Architecture Testing”, http://blogs.msdn.com/pagtest/archive/ 2005/03/18/398678.aspx • Louis Marshall, “Project Management for the Web: Quality Test Plan”, http://pm4web.blogspot.com/ 2008/07/quality-test-plan.html • Dr Ghazy Assassa, “Software Engineering: Test Case Template and Example”, http://faculty.ksu.edu.sa/ghazy/ CSC342_Tools/Test%20Case%20Template.pdf • GSA, “FIPS 201 Evaliation Program - Template Generator Test Procedure”, http://fips201ep.cio.gov/ documents/Template%20Generator_Test%20Procedure_v2.0.0.pdf
  • 38.
    References • QA Plan, “Test Suite”, http://readyset.tigris.org/nonav/templates/test-suite.html

Editor's Notes

  • #50 A Quality Attribute Scenario is a quality-attribute-specific requirement.