Thread: Software Testing, references & bibliography

  1. #1
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446

    Software Testing, references & bibliography

    I'd like to do some software testing on my current project. It's a fairly complex set of code running on the hundredths of thousands of lines, OOP based, including both multi-threaded and single-threaded portions, and with its fair share of dependencies (boost, sqlite, ncurses).

    I'd like for the first time to approach this in a better way, instead of the ad-hoc attitude I've always took towards software testing. However I lack the background and would appreciate some references and bibliography anyone could give me on the subject of Unit Testing in particular, and Software Testing in general. I'd also appreciate some suggestions on the matter of tools I could use. But most important for now is indeed learning about the workflow(s) and processes involved in software testing.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    That's what I get paid for.

    The first thing I would do is come up with a set of Test Cases. I just use a spread sheet to enter my test cases into. I use these columns:

    Code:
    ID | Pre-condition setup | Test Steps | Expected Results | Pass/Fail
    Give each test a unique ID (not required, but useful for organizing hundreds of test cases), list any steps you need to do before you run the tests in the Pre-condition Setup, put the explicit steps required in the Test Steps, put what should happen in Expected Results, and when you run the tests you can put a P or F in the Pass/Fail column. Only put one test per row, don't try to do too much in a single test; and don't make the test steps or expected results ambiguous in the slightest bit, otherwise it might affect the reproducibility of the test later.

    Once you have a good set of manual tests you can run, you can try adding automated tests. Try looking into a framework like cppunit to organize your automated tests. These usually test individual functions or classes by passing valid & invalid values to them, as well as doing bounds checking (i.e. pass the minimumum, maximum, min - 1 & max + 1 values to see if they are handled properly), pass null pointers, empty strings...
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I've use both cppunit and EZunit. I both love and hate them. I find EZunit has too many macros but it is effective ..but very mundane programming.

    I would also recommend using a code coverage tool such as Bullseye when running your unit tests. This will give you a fair indication of how much coverage you are getting and how you can tweak your unit tests to force errors. Most of the uncovered areas will be exception and error handlers. You may then have to force errors in order to exercise those sections of code. Generally 80% code coverage is what I shoot for with more being even better.

    I do not have a lot of experience with automated testing so I cannot give any advice about that. There are several tools available which will do automated testing so you might check into some of those and see if they will work for you. There are also tools that plug right into Visual Studio that can simulate faults and put a load on the system which are very useful for testing.
    Last edited by VirtualAce; 08-21-2009 at 09:19 PM.

  4. #4
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    Mainframe assembler programmer by trade. C coder when I can.

  5. #5
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Thanks folks. I should take it from here. Your pointers will get me there.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Let me know what you come up with. I'm always looking for new code analysis and testing tools so if you come upon one that you really like I would appreciate if you would let me know either here or in a PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why C Matters
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 136
    Last Post: 01-16-2008, 09:09 AM
  2. Software performance and benchmark testing
    By cjschw in forum C++ Programming
    Replies: 1
    Last Post: 03-17-2004, 02:24 PM
  3. Software Testing Techniques -by Boris Beizer
    By zahid in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-06-2002, 08:12 AM
  4. Question about Software Testing
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 04-08-2002, 09:47 AM
  5. Software Testing to Programming
    By stratovarius519 in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 02-23-2002, 01:05 PM