POV-Ray : Newsgroups : povray.off-topic : Q about Unit Tests : Re: Q about Unit Tests Server Time
4 Sep 2024 17:20:33 EDT (-0400)
  Re: Q about Unit Tests  
From: Stephen
Date: 4 Dec 2009 06:24:58
Message: <4b18f18a$1@news.povray.org>
Darren New wrote:
> OK, so I have a media player.
> 
> After initialization, it should have a mode of "stopped" and a speed of 
> 100% and a volume of 100% and an empty error code and an elapsed time of 
> zero.
> 
> So I write a unit test to create and initialize a player, then check 
> that answer.
> 
> Now I want to make sure elapsed time moves forward while playing. So I 
> create a player and initialize it, tell it to play, wait 12 seconds, and 
> make sure I have about 10 seconds of elapsed time in the elapsed time 
> counter.
> 
> The question is this: since all tests are supposed to be independent, 
> should I test that after initialization I have a speed of 100%, mode of 
> stopped, and all that yadda in the first test? Or can I assume that 
> first test worked, and just test that switching to play makes the mode 
> go to "playing" and the elapsed time counter increment?
> 
> What do people who write lots of unit tests suggest?
> 
> 
> 
My understanding of unit testing is that they are just used to test one 
aspect of the software, independently. You then go on to write a system 
test which tests the end to end process. That is followed by an 
integration test, testing any links to other parts of the program. 
Finally there is the UAT or User Acceptance Test where you hold your 
breath as the customer tries to break it ;)
Integration testing may not be applicable in your case. I hope this helps.
As an aside it does not always work this way. Last week we were system 
testing at the same time I was doing development. (What a way to run a 
project!) Now were are to start Integration Testing and some of the unit 
tests have not been documented. (I hate project managers who never leave 
their M$ Project and look at the real world)


-- 

Best Regards,
	Stephen


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.