Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re: OT: Data Structure First or Code First?

by dws (Chancellor)
on Mar 29, 2002 at 21:25 UTC ( [id://155336]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: OT: Data Structure First or Code First?
in thread OT: Data Structure First or Code First?

A unit test exercises an API and verifies that it returns correct values for correct inputs, and handles incorrect inputs correctly. In your case, I'm guessing that your API will produce an HTML table given (at least) a date.

A simple unit test might feed that API several dates, comparing the resulting HTML to known-good reference copies.

To make this work will probably require that you get your data access abstraction right, so that you can pass a stubbed database in for testing purposes. Or, you can structure the calendar object such that it's populated by a separate agent. Use a dummy agent for populating with test data, and a real agent (which you write separate unit tests for) for accessing the database.

  • Comment on Re: Re: Re: OT: Data Structure First or Code First?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://155336]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-16 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found