vikash dat
vikash dat

Reputation: 1514

Unit testing at a higher level

I have a legacy code base in php, and we have a few applications in python (new codebase). I am attempting to migrate the legacy pieces to the new codebase/language. Currently I can only think of the use of regression testing (meaning someone manually visiting the links the legacy code once handled) to validate and verify the code was migrated successfully. However I am a huge fan of unit testing, and want to know if it is possible to apply unit testing at a higher level. So my tests would sit above the php/python level and be unaware of the specifics of the level below it. An example would be if the php once handled a GET request. I code the unit test above the application level to verify the responses to the GET request. I then swap out the php code with python code, and have the test break until I can make it succeed. I suppose what I am trying to do is define an interface at a higher level than application level, and use that interface to unit test. Is this possible/heard of? or am I barking up the wrong tree?

Upvotes: 4

Views: 110

Answers (2)

khmarbaise
khmarbaise

Reputation: 97409

Not to forget about JWebUnit

Upvotes: 1

Péter Török
Péter Török

Reputation: 116266

What you describe are perfectly valid and good tests, albeit not unit tests - rather, integration / functional / acceptance tests. Still, such tests can be run using a conventional unit testing framework. However, there are tools specialized for this too.

I haven't got much experience in web testing, but have a look at HttpUnit or FitNesse.

Upvotes: 3

Related Questions