Practical Software Testing Resources?
rhartness asks: "I've been a software engineer by profession for a few years and a programming enthusiast for much longer. As my experience has increased, so has the size of the projects that I have had to work on. My software testing method involves trying to do everything I can think of that the end user might try to do. Hopefully, this will break the application if there is a bug within my code. The current project that I am working on involves numerous tiers within a smart client environment. Trial and error testing is no longer sufficient — there is simply too much that could happen. Searching the Internet for software testing resources provides an abundant amount of information but it's often quite philosophical and verbose. What are some practical resources that Slashdot readers use for testing your software projects?"
Release it with a big BETA label. Let your customers find the bugs.
TDD, JUnit (or equivalent), FIT. Well-tested, independent tiers. GUI test as a last resort, or with humans.
--Robert
Read "The Art of Software Testing" by Glenford Myers. Even if you only get a few chapters in, you'll get a lot of ideas that will improve your testing. "Testing Computer Software" by Cem Kaner is another good one.
A huge step is to put in unit testing / regression testing that's run nightly, and idealy with every build. You should at least cover the basics, e.g., at the persistence level can you create/read/update/delete a record? If you load a parent object, do dependent objects get loaded as well? At the presentation layer you can verify that a missing field will set the right error message.
You still need to do additional testing, but this will catch the underlying errors that can cause flakiness -- and worse, bad workaround -- at the higher levels in your code.
For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
What truth?
There is no dupe
Step 1: write a systematic test plan. There are all kinds of acronyms and books out there on the subject - I doubt you need it. At the very least you can start with CRUD (Create, Read, Update, Delete) and go from there. Cover the success path, cover the failure paths.
Step 2: automate. This isn't optional if you're planning to maintain a project beyond the 1.0 release. For specifics, it depends on your project. Is it mostly a Java app (http://www.junit.org/)? Is a lot of the logic in the database (http://www.dbunit.org/)? Is it a web app, regardless of language (http://webtest.canoo.com, http://wtr.rubyforge.org/)?
Step 3: run your automated tests and laugh at how much easier it makes your life than manual testing.
ClutterMe.com - easiest site creation on the Net. Just click and type.
While full-time testers are often made fun of, ("Those who can't code, test."), or it is considered a secondary role that developers can perform on their own, there is no replacement for an experienced tester.
Testing is an important part of the development process. If you have an expensive and complex application, do yourself a favor, and hire a test team. Don't try to do it yourself, unless you have no choice. You may do an OK job of it, but it sounds like you don't have the experience to do it properly. This isn't a critique of your skills, it is a fact that you have a different skillset. You don't expect an embedded programmer to develop web apps or vice-versa. Could they do it? Sure. But it will be a long and difficult road as they make the mistakes an experienced person already known how to avoid.
If you have decided that comprehensive testing is important, (and some people decide it isn't), then do the right thing and get professional (test) help.
Reading code is like reading the dictionary - you have to read half of it before you can go back and understand it.
- JUnit
- NUnit
- PhpUnit (I think there are multiple versions)
- Php SimpleTest
Of these, I actually like SimpleTest the best so far, but I don't have more than a passing familiarity with any of them.In terms of code quality, I think I've got more mileage out of goodish coding practices (separation of business/presentation logic, lots of acceptance testing) and libraries that support rapid development (eg DB_DataObject, HTML_QuickForms, Propel, Smarty).
I'm a big fan of "Software Testing In The Real World: Improving The Process (ACM Press)", Edward Kit (ISBN 0201877562.) It got me thinking about testing at a time when I hadn't really gotten the "testing bug."
B3 t+ w+ f+ g++ s- -- it's a bear thing...
First off, you should be practicing TDD (Test Driven Development) as discribed here: http://en.wikipedia.org/wiki/Test_driven_developme nt ast egration.html.
well as Continuous Integration as discribed here: http://www.martinfowler.com/articles/continuousIn
The next thing you need to do is hire some testers. TDD and CI can help make fantastic improvements in the quality of your code, but you will never replace the time and effort of another human working to break your code.
*** Sigs are a stupid waste of bandwidth.
The most common software testing solution that effectively tests a system of the complexity you have described is called "Production". Amazing how effective the "Production" environment is at locating all of the hard to find bugs. Anything less just won't do.
Short of 'production', Mercury makes some excellent tools, but they're more for automated regression or load than for full coverage.
is competition good, or is duplication of effort bad?
"I've been a software engineer by profession for a few years and a programming enthusiast for much longer."
Programmers aren't engineers.
Let me start by saying that there is no one size fits all
solution. You described the nature of your projects to a degree, but
not the nature of your employment.
Do you work for a company or are you a contractor? Is your
responsiblity just for your code or the application as a whole (which
is another way of asking how big the team is in most cases)? Are the
users of the software someone close to you, you can ask them "does this
do what you want" or is this going to go on the shelf in a store and
you have no idea who might wind up using it?
I think these kinds of things factor into the equation. For example a
number of people have suggested having dedicated testers. My guess is
if you had them, you wouldn't be asking slashdot. And if you don't,
it's probably not something you can make happen by yourself, though it
might be a good point to bring up to your coworkers/boss.
I disagree with the Unit Testing advice that is being given out
too. You should have unit tests, but it will only get you so far. Unit
tests are effective at guarding against bugs being introduced when
making changes, but far from sufficient to make sure there are no bugs
in the entire system. In my experience the people who most heavily
rely on unit tests are also the ones who produce the buggiest code. I
think some of the comments make them out to be more of a panacea than
they actually are, and worse yet can lead to a false sense of
security.
Automation is extremely helpful. However if your issue is that " there
is simply too much that could happen", it's hard to realistically
automate all those paths. Presumably a problem with the things like
CRUD operations are going to be tested in virtually any path through
the application, which is why I don't think unit tests are necessarily
what you are looking for. Still do automate everything you can, just
be aware of the limitations.
My advice is as follows:
1) Keep doing what you're doing. You won't be able to catch
everything, but if you stop trying to do mimic what you think an
end user will do, you're going to miss a lot of things.
2) Write code that is likely to be bug free. Easier said than done,
but it's extremely important. Comment things, use descriptive
names, clear separation of concerns. You already know this, but
don't lose sight of it.
3) Use a logging framework. Have an error reporter for client side
apps. Write assertion checks into your code. If you try to insert a
row into the database, check the return value to see how many rows
were inserted. If you expected 1 and got something else, make sure
it's logged so you can find it later. Make sure you log as much
about the data/application state as reasonable so you can tell what
circumstances cause that problem. Make sure it's logged in such a
way that you can distinguish between serious errors like this and
as-you-go debugging output.
4) Do code reviews with other programmers. Develop best
practices. Re-evaluate them periodically to make sure they are
still "best".
5) Have a short write, compile, run cycle. Test that code as soon as
you can after writing it. If you find one of those "hmmm... I think
this should work", try to verify as soon as you can before you
forget. Don't wait until the end of the day and then conclude
"guess it worked". Test corner cases while the corner cases are
still apparent to you. If getting just created code to run is a big
pain in the ass (which could mean o
www.opensourcetesting.com
Anyone know if there are open source equivalent applications to Winrnnner or Loadrunner?
Someone above recommended Edward Kit's book. Definitely worth reading, imo.
:)
But the biggest reason I see for developers not being so good at testing, is that they are of the mind set that they try to show how the SUT does work. Not really in the least bit helpful, that is what your unit tests should have been doing. No, the mind set is 'In what ways does this fail?'. All software fails, you just have to find out how. That is probably one of the reasons you think so much of the literature is of a philosophical bent, because it is. There are techniques that can help you find the places where it'll break (wikipedia - boundary value analysis, equivalence partitions and software testing may help), but ultimately it is just a form of scientific method. Your SUT is a hypothesis, the only way to show validity is by attempting all you can to disprove it.
You may want to have a quick read of James Bach's site, and may even see if you can get yourself along to one of his trainings.
GUI test automation (Mercury, Compuware et al) - they are potentially useful, but you need to be able to understand how to test before you can write good automated tests. Unfortunately this is often not the case, hence the oft heard saying "Test automation, enabling you to test badly, quicker." Test automation is not the same as manual testing, you need to understand how it is different for it to be of value (beyond unit testing - you probably know how to unit test, hence you probably have at least an initial idea of how to automtate unit tests).
Feel free to ask more, or disagree, or just curse me some
And just to own up to my own bias, I've been a tester for around 15 years.
The best is the enemy of the good
More up-to-date examples et. Al.
although I agree that a production environment can help make a good test effort it is not always practical or feasible and I think the poster actually needs to hear about best practices, methodologies, tools etc rather than just being told to get a production environment.
Also, many unit and functional tests don't need a full blown production environment either -at least not until integration testing...
If the production environment consists of $1 million worth of HW and dedicated outbound feeds to banks and inbound feeds from a stock market for instance it is unlikely that it can be duplicated exactly because you would have to get the bank to set up a bunch of dummy financial transaction servers, pay for another feed from the market, buy a bunch more oracle licenses, etc
I worked on one deathmarch project where the production environment for an online Supply chain management solution consisted of 150 servers! Since they couldn't afford another 150 servers for the test environment they gave us 75 servers for front-end and middleware and had us connect to the backend of the production environment....
Sometimes you have to stub out or simulate external systems and it is important then to know how those systems interface with your SIT (system under test) and how you can properly simulate that interface and important interface events and messages.
If you don't have access to intelligent testers then you at least need to get feedback from the system users so that you can build business case scenarios from which you can derive test cases to ensure full functional coverage.
-What's the speed of dark?
First, you should write a test plan. Actually, scratch that... first, you should write a design document. You have one of those, right? If not, you don't know what you're testing, and will eventually fail to cover some portion of your product, and that portion will likely break. Once you have a halfway decent design document, write a test plan that refers to your design document.
I'm going to second the notion I've seen in other posts that if your project really is big, there should be a programmer or analyst dedicated to testing it. You can hire someone who is less of a programmer and more of a tester if you want, but you'll get the best coverage if you can find someone with real programming chops who is able to design and implement tests. If you're doing your project right, that QA team will be every bit as involved in every portion of your project as you are.
Without knowing more about your particular project, it's very difficult to suggest appropriate tools. Different types of systems require different approaches to testing.
As a software engineer, I would have expected you to rely less on sanity tests, and more on formal verification. That's what we did in the (few) software engineering courses that I took. I don't know if there are any verification tools for the programming language you are using (the ones I used were all for toy languages), but that was my first thought.
Please correct me if I got my facts wrong.
[url]http://portal.acm.org/citation.cfm?id=1138929 .1138952&coll=GUIDE&dl=&type=series&idx=1138929&pa rt=Proceedings&WantType=Proceedings&title=Internat ional%20Conference%20on%20Software%20Engineering&C FID=15151515&CFTOKEN=6184618[/url]
Go to wikipedia, look up software testing. Click aon some of the referenced links, then chase those links and you will find a wealth of information.
Just google +"software testing" you will find tons of links.
you might try these guys: http://www.softwareqatest.com/
They have some nice links as well.
Or would you rather start with a newsgroup? Go to google news groups and seach on software testing again. Lots of knowledgable and helpful folks hang out on those boards.
BTW, a colorful phrase for "trying to test everything a user might do" is "soap opera testing". Google it, the story behind the name is sort of fun.
putting the 'B' in LGBTQ+
TDD - test driven development - means that you write tests before you write the code. Good TDD is actually BDD - behavior driven development. Write unit tests that are specifications for behavior. Continuous integration means that unit tests are automatically ran whenever code is integrated. Obviously this is just a matter of automation. Look for a test framework in the language you code in. There are lots of frameworks out there now. One way to whittle them down is to pick one that supports mock objects (or functions), which is a way of quickly simulating interactions. For Ruby, rspec is awesome. For C, I am trying out Cgreen right now- looks promising.
STAF will support you in automating tests.
The effort to implement something will approximately double, but you'll have a continuously regression tested system/project.
sigs are for nerds
If you have the option: I do all of the testing that I can, but I also write in that in the event of an exception write to a log (standard) and then email to me an exception report. The exception report typically contains the user that hit it, the page/file that hit it, and method that returned the exception. In the morning I drink coffee and read fix up the exceptions. Luckily, I haven't received any lately (fingers crossed).