The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Software Testing >> Unit Testing

Pages: 1
DougReeder
Newbie


Reged: 11/01/10
Posts: 4
How to handle tests that fail for an OS version?
      #647392 - 11/01/10 12:38 PM

Currently the platform I'm developing for is undergoing a major update. Some functionality has been added, some has been removed without a direct replacement. While some differences can be coded around, some differences in the platform result in different functionality for the end user.

One example: the version of JavaScript in the new version of the platform can parse dates in the format "2009-07-06T11:23", while the older version cannot. It's not worth it to code a workaround for the older version of the platform, so entering dates in that format will not work for users.

What is the usual way to handle the unit tests that fail on the older platform? Having tests that will always fail under the old platform, but pass under the new platform seems untidy. But also, tests should not vary by platform.

Edited by DougReeder (11/01/10 12:39 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Joe Strazzere
Moderator


Reged: 05/15/00
Posts: 12344
Loc: Massachusetts, USA
Re: How to handle tests that fail for an OS version? [Re: DougReeder]
      #647534 - 11/02/10 08:35 AM

Quote:

But also, tests should not vary by platform.




Why not?

If the requirement is indeed to support "2009-07-06T11:23" on the new platform but not the old platform, doesn't that imply you must have different tests on different platforms?

--------------------
- Joe
Visit AllThingsQuality.com to learn more about quality, testing, and QA!

I speak only for me. I do not speak for my employer, nor for anyone else.


Post Extras: Print Post   Remind Me!   Notify Moderator  
DougReeder
Newbie


Reged: 11/01/10
Posts: 4
Re: How to handle tests that fail for an OS version? [Re: Joe Strazzere]
      #647554 - 11/02/10 10:10 AM

Quote:

Quote:

But also, tests should not vary by platform.




Why not?

If the requirement is indeed to support "2009-07-06T11:23" on the new platform but not the old platform, doesn't that imply you must have different tests on different platforms?



"No conditional logic" is a general recommendation for unit testing best practice, for example: http://www.slideshare.net/nickokiss/unit-testing-best-practices

But I think I've come around to your thinking, and would modify the recommendation as follows:

conditional logic in unit tests only to support requirements that vary by platform

Before, I was thinking I'd have put conditional logic that always passed the unit test if it was running on the old platform, but now I see I can wrap the unit test in in an if statement so the unit test doesn't run at all on the old platform.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Joe Strazzere
Moderator


Reged: 05/15/00
Posts: 12344
Loc: Massachusetts, USA
Re: How to handle tests that fail for an OS version? [Re: DougReeder]
      #647579 - 11/02/10 01:10 PM

Quote:

"No conditional logic" is a general recommendation for unit testing best practice




Yet another reason why I don't believe in best practices.

Use what works for you, and don't use what doesn't work for you.

--------------------
- Joe
Visit AllThingsQuality.com to learn more about quality, testing, and QA!

I speak only for me. I do not speak for my employer, nor for anyone else.


Post Extras: Print Post   Remind Me!   Notify Moderator  
CPat
Member


Reged: 12/08/09
Posts: 102
Re: How to handle tests that fail for an OS version? [Re: Joe Strazzere]
      #648063 - 11/08/10 10:32 AM

Quote:

Quote:

"No conditional logic" is a general recommendation for unit testing best practice




Yet another reason why I don't believe in best practices.

Use what works for you, and don't use what doesn't work for you.




You can take away the best practices, but you'll still be left with the people who apply them without attempting to understand them. Which do you think is the more serious problem?


Post Extras: Print Post   Remind Me!   Notify Moderator  
Joe Strazzere
Moderator


Reged: 05/15/00
Posts: 12344
Loc: Massachusetts, USA
Re: How to handle tests that fail for an OS version? [Re: CPat]
      #648078 - 11/08/10 01:24 PM

Quote:

You can take away the best practices, but you'll still be left with the people who apply them without attempting to understand them. Which do you think is the more serious problem?




I think one too often leads to the other.

--------------------
- Joe
Visit AllThingsQuality.com to learn more about quality, testing, and QA!

I speak only for me. I do not speak for my employer, nor for anyone else.


Post Extras: Print Post   Remind Me!   Notify Moderator  
TestingMentor
Member


Reged: 12/28/06
Posts: 235
Loc: Seattle, Washington
Re: How to handle tests that fail for an OS version? [Re: DougReeder]
      #650743 - 12/01/10 08:34 AM

Hi Doug,

We encounter this situation a lot at various levels of testing. You might consider taking a look at some examples of platform profiling. The examples illustrate how to detect different OS versions, but you could also differentiate on version #, etc.

http://www.testingmentor.com/imtesty/2009/11/18/test-automation-programmatic-platform-profiling/

http://www.testingmentor.com/imtesty/201...ersion-part-ii/

--------------------
- Bj -
I.M. Testy blog
Testing Mentor


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 4 anonymous users are browsing this forum.

Moderator:  AJ, Jeanj 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 3134

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5