Does TDD apply well when developing an UI?

前端 未结 10 1055
野趣味
野趣味 2020-12-14 08:56

What are your opinions and experiences regarding using TDD when developing an user interface?

I have been pondering about this question for some time now and just ca

10条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-14 09:38

    Based on your edit, here's a little more detail about how we do it on my current team. I'm doing Java with GWT, so the application to Silverlight might be a bit off.

    Requirement or bug comes in to the developer. If there is a UI change (L&F) we do a quick mock up of the UI change and send it over to the product owner for approval. While we are waiting on that, we start the TDD process.

    We start with at least on of either a Web test (using Selenium to drive user clicks in a browser), or a "headless" functional test using Concordion, FiT or something like it. Once that's done and failing, we have a high level vision of where to attack the underlying services in order to make the system work right.

    Next step is to dig down and write some failing unit and integration tests (I think of unit tests as stand-alone, no dependencies, no data, etc. Integration tests are fully wired tests that read/write to the database, etc.)

    Then, I make it work from bottom up. Sounds like your TDD background will let you extrapolate the benefits here. Refactor on the way up as well....

提交回复
热议问题