Does TDD apply well when developing an UI?

前端 未结 10 1056
野趣味
野趣味 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:34

    GUIs by their very nature are difficult to test, so as Brian Rasmussen suggests keep the dialog box code separate from the the GUI code.

    This is the Humble Dialog Box Pattern.

    For example, you may have a dialog box where details (e.g. credit card number) are input and you need to verify them. For this case you would put the code that checks the credit card number with the Luhn algorithm into a separate object which you test. (The algorithm in question just tests if the number is plausible - it's designed for checking for transcription errors.)

提交回复
热议问题