Docstoc

Software development

Document Sample
Software development Powered By Docstoc
					Software development
(Based on 14 years of experience leading Smalltalk projects)




            Leandro Caniglia
            Caesar Systems
             (Houston & Buenos Aires)
The vicious cycles (I)


 Developers                 The Software
   deliver                    creates
  Software                   new needs




              Pressure is
              conveyed to
              Developers
The vicious cycles (II)


 Programmers                  Understanding
     hack                         gets
   the code                      harder




               Programmers
               are replaced
                by newbies
Coding Culture

            All dev team members
            should write code every
            day

            All dev team members
            should debug every day

            All dev team members
            should write SUnit tests
            every day
  The Testing Culture: Part 1
  Code               New feature
                      New feature        Unit test(s)
                                          Unit test(s)          New
   Code
  base           +   source code
                      source code   +   (must pass)
                                         (must pass)     =       New
                                                             code base
   base                                                       code base


All tests pass                                               All tests pass


  Code                Unit test
                       Unit test
   Code
  base           +   (must fail)
                      (must fail)
   base

                                                             All tests pass


  Code                  Bug fix
                         Bug fix          Unit test
                                           Unit test            New
   Code
  base           +   source code
                      source code   +   (must pass)
                                         (must pass)     =       New
                                                             code base
   base                                                       code base
   Three properties of tests
Unit tests must be simple, not trivial
 Unit tests must be simple, not trivial
(do not test setters & getters, etc.)
 (do not test setters & getters, etc.)

Unit tests should not depend on
 Unit tests should not depend on
implementation details
 implementation details

Unit tests should be fast
 Unit tests should be fast
(number of tests * duration = total time)
 (number of tests * duration = total time)
The Testing Culture: Part 2

           Process Inputs
            Process Inputs

                                             UI validation



                                                             Intrinsic validation
                                                              Intrinsic validation

                Model
                 Model       Yes
              changed?             Validate model
                                    Validate model
               changed?
                                                         Informative UI feedback
                                                          Informative UI feedback


                                   Collect failures
                                    Collect failures
  Extreme validation
The Testing Culture: Part 3


  Process
   Process     Test models
 next model
  next model

 Make global     System
                  System
 Make global
 assertions
  assertions
                 Results
   Collect
    Collect
   issues
    issues
The Testing Culture: Part 3


   Process
    Process                     Test models
  next model
   next model

   Compare         Previous version
                    Previous version        New version
                                             New version
    Compare
    results
     results
                                  Results
 Fix or explain
  Fix or explain
  differences
   differences
 The Testing Culture: Part 4
Dev
 Dev                   QA
                       QA

                                   Dev
                                    Dev
                                   (7)
                                    (7)   QA
                                           QA
       QA       Dev                       (5)
                                           (5)
       QA        Dev
  Wrong?         Wrong?              Right?



       Dev
       Dev                    QA
                              QA
             Loose coupling
       The Evergreen System

   Unit Tests
   Unit Tests                    Traditional QA
                                 Traditional QA
    (5,000)
     (5,000)                        (10,000)
                                     (10,000)
                     Evergreen
                     Evergreen
                      System
                       System

Integration Tests
 Integration Tests                 Validators
                                   Validators
       (50)
        (50)                        (1,000)
                                     (1,000)
           Internal QA: code revision
          A new change set
           A new change set
              is created
               is created
                                     No exceptions

            Change set is
             Change set is                                     Authors apply
                                                                Authors apply
              submitted
               submitted               Very usual & useful    the change set
                                                               the change set
                                                                for inclusion
                                                                 for inclusion

          Reviewers analyze
           Reviewers analyze             Reviewers modify
                                          Reviewers modify
            the change set
             the change set               the change set
                                           the change set
Unusual
                                                     Yes

  No          Approved         Yes           Observed        Change set is sent
                                                              Change set is sent
               Approved                       Observed
                 ??                             ??           back to its authors
                                                              back to its authors
             Complexity metrics

   Size
    Size        Structure
                 Structure      Linguistic
                                 Linguistic         QA
                                                     QA
##classes
   classes     ##arguments
                  arguments       words
                                   words         % coverage
                                                 % coverage
##methods
  methods         ##slots
                     slots       incursion
                                  incursion      % recidivism
                                                 % recidivism
   LOC
    LOC        #msgs/method
                #msgs/method   polymorphism
                                polymorphism         age
                                                      age
                class depth
                 class depth    ##identifiers
                                   identifiers
Ad hoc GUI programming



Fuzzy model                       Model logic
                   Ad hoc GUI
                    Ad hoc GUI
                  programming
                   programming




Partial refresh                  Circular update
Predictable GUI programming



  Single model                        No model logic
                    Predictable
                     Predictable
                        GUI
                        GUI
                   programming
                    programming




 Extreme refresh                   Unidirectional update
               Questions
• What’s the overhead of writing tests and
  validators?
• Is Extreme Validation fast enough?
• What’s the overhead of code reviewing?
• What’s the impact of databases?
• What if extreme refreshing generates
  flicking?
                   The system kernel

                                          easy
                       easy
                                                         possible

                                    Kernel
                                    Kernel
          attainable

                         central
                                                                    negative
                                                 risky
distant                            easy
       Controlling the complexity
                              cumulative
                              number of
                               methods                          recent
          Zero                                    kernel
       refactoring


                                       legacy

past                       today     past                            today


          Concavity = 0    Concavity > 0        Concavity < 0
          No refactoring     Refactoring        Kernel reuse
               Managing the triad

Low complexity
 Low complexity                                Predictably programmed
                                                Predictably programmed
Evergreen kernel
 Evergreen kernel                              SUnit tested
                                                SUnit tested
Specification compliant
 Specification compliant                       Professional look & feel
                                                Professional look & feel
                           Model          GUI



                               Database

                                          Built on the same model
                                           Built on the same model
                                          Transparent
                                           Transparent
           Documentation
   Actual domain
    Actual domain                       Model
                                         Model
      (reality)
       (reality)                     (abstraction)
                                      (abstraction)




Actual domain
 Actual domain      Conceptual
                     Conceptual          Computational
                                          Computational
   (reality)
    (reality)       specification
                     specification          model
                                             model




  User Story        Specification
                     Specification
   User Story        document            Implementation
                      document
                   Specification documents
     F0
      F0
                                                                                             Same reserves
                  Lag: 10         F1: 15                                                      Same reserves
                   Lag: 10         F1: 15                                                                                  Same pressure
                                                                                               Same pressure                Same pressure
                                                                                                Same pressure
                                              F2: 10
                                               F2: 10                                           Total rate = Q
                                                                                                 Total rate = Q             Total rate = 2·Q
                                                                                                                             Total rate = 2·Q
                       Lag: 15      F3: 10
                        Lag: 15      F3: 10

                   5         F4: 20
                       5      F4: 20




first estimate                                                                                    Injector
                                                                                                                  Capacity constraint

  drilling
                                                    deferment
                 drilling
                                              second estimate                                                                             Remaining
                             drilling                                                      Fluid supply                                     fluid
             first schedule                        facility construction
                                                                           drilling                                      Injected fluid

                       re-scheduling                                                               Well
                                                                                timeline
The usual hierarchy
    Very Important Manager
     Very Important Manager


    Quite Important Manager
    Quite Important Manager


     Technogoy Manager
      Technogoy Manager

       Software Architect
        Software Architect

      Software Designer
       Software Designer

      Functional Analyst
       Functional Analyst
        Project Leader
         Project Leader
         Programmer
          Programmer