Tuesday, January 18, 2011

Programming: how to do it better

2 nice video on how to program better. All in all, I think I got some ideas on how to do better testing. 2 types of testing packages will be created. One for object testing, another packages will be multiple situation testing for the following routine as an example (login, search, read email, delete mail, refresh inbox, search). Probably another for bug fixes?

I've got doubt in formal prove as you may prove within a system, things are bug-free. However, what if, multiple systems do interact and something right on one system might result in fault at the other.  However if I can prove program is bug-free formally, it will be great! But life would probably be very sucky looking back at discrete maths. Noooooo!!!

Wisdom
  1. design code components so they cant be used incorrectly
  2. make good use of compiler features like -wall and -wextra to find "invisible" errors
  3. Use of tools like valgrind to check for memory leaks
  4. Testing
    1. Core concept
      • automated
      • repeatable
      • as comprehensive as possible
      • seperate code and test
      • new test for new feature or bug fixed
    2. Limitations
      • only show the presence of bug
      • buggy test
      • test coverage is never complete
      • oo testing required per object = no of change state x number of state
      • looking deeper into bug to fix the processes
      1. Future
        • better languages
        • type systems (curry-howard isomorphism)
        • theorem prover to show its bug-free. more code for testing then the original code!

    Part 1, 2

    No comments:

    Post a Comment