google app engine - How to apply TDD to web API development -


i'm designing web service running on google app engine scrapes number of websites , presents data via restful interface. based on background reading, think i'd attempt test driven development (tdd) , develop tests before write business code.

my problem caused fact list of scraped elements includes timetables , other records change quite frequently. limit of knowledge on tdd write tests examine results of code execution , compare these results hardcoded result set. seeing data set changes frequently, method seems impossible. assuming true, best approach test such api? how large-scale web api tested (twitter, google, netflix etc.)?

you have choose type of test:

  1. unit tests test proper operation of modules (units). provide input data , test code outputs proper results. if there system dependent classes try mock them or in case of gae services, use google provided local services. unit tests can run locally on machine or on ci servers. there 2 popular unit test libs java: junit & testng.
  2. integration tests check various modules (internal & external) work - check apis between modules working. run on real servers , call real external services. technology specific , harder run.

in case, i'd go unit tests , provide sets of different input data logic should parse , act upon. since flow pretty simple (load data fixed url, parse it) embed loading of real data unit tests (we when parse external sources).


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -