开发者

Can i use TDD in android developing process?

开发者 https://www.devze.com 2023-04-11 22:15 出处:网络
I am a newbie to android. And feels like TDD can reduce developing time a lot. But after learning android\'s junit test framework, find it a bit difficult to achieve the goal that write test before co

I am a newbie to android. And feels like TDD can reduce developing time a lot. But after learning android's junit test framework, find it a bit difficult to achieve the goal that write test before coding. Especially when i want to test module like adapters, views and databases. So i wonder it's because i am not familiar with android test framework enough or android is not s开发者_高级运维uitable for TDD.


Sure.. :-) In general TDD approach can be used for developing Android apps too. But not always worth.

It sometimes needs more effort, so you should consider the pros and cons carefully. I think you should not force to do every little part of your development process to be test-driven, but consider using it every time before you start typing. I prefer mixing TDD with test-last approach.


You can try by using robolectric https://github.com/pivotal/robolectric and here is sample https://github.com/pivotal/RobolectricSample

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号