Ada: using aunit
I came across the tool aunit for writing test drivers. I write quite simple Ada programs and was wondering if it's worth to learn aunit and use it even on simple programs. I looked at the aunit manual and I didn't find easy examples to start with. Are there other sources around that show how to use开发者_JAVA百科 aunit?
I understand that using aunit can be a time-saver.
Thanks a lot...
I tried it once, but honestly it was so long ago I've forgotten how well it worked out for me. It think it was useful, but of course there are some situations you can't easily reproduce with a framework.
Most likely it would be more valuable if you are expecting to make a fair amount of releases and/or bug fixes, and are worried about possible regressions.
The AUnit Cookbook (http://libre.adacore.com/wp-content/files/auto_update/aunit-docs/aunit.html) does a fairly good job explaining how to use AUnit. It gives plenty of examples and should be enough to get you started.
AUnit (like other xUnit frameworks) are great for testing individual modules of your code. If you are doing serious development of any kind I recommend you create functional tests in AUnit for each module and have the tests run at the end of your build. It will help you catch problems early and ensure that later changes do not break working code.
精彩评论