tdd

Should I Use TDD?

依然范特西╮ 提交于 2019-11-27 09:40:52
问题 I'm the only developer in my (very small) company and I'm about to start on a medium sized ASP.NET web application for said company. I'm trying to figure out if I should learn Test Driven Development (TDD) and implement it in this application. I need to start developing our new application shortly and I'm worried about testing. I've programmed for many years but have never done any unit testing. I've read numerous online resources regarding TDD but I'm unsure whether I'll have a 'good enough'

What should I consider when choosing a mocking framework for .Net

橙三吉。 提交于 2019-11-27 09:37:17
问题 There are lots of mocking frameworks out there for .Net. There is no clear winner that has superseded the others in every way. The leading mocking frameworks also have many different styles of usage. The time it takes to learn all of the mocking frameworks well enough to decide which to use is unreasonable. I don’t believe that we have yet reached a stage that we can talk about the best mocking framework. So what questions should I be asking, both about the project, and about myself, to help

How to write testable controllers with private methods in AngularJs?

丶灬走出姿态 提交于 2019-11-27 09:31:45
问题 Alright, so I have been stumbling upon some issue for a long time and I would like to hear an opinion from the rest of community. First, let's look at some abstract controller. function Ctrl($scope, anyService) { $scope.field = "field"; $scope.whenClicked = function() { util(); }; function util() { anyService.doSmth(); } } Clearly we have here: regular scaffold for controller with $scope and some service injected some field and function attached to the scope private method util() Now, I'd

BDD with Cucumber and rspec - when is this redundant?

两盒软妹~` 提交于 2019-11-27 09:14:48
问题 A Rails/tool specific version of: How deep are your unit tests? Right now, I currently write: Cucumber features (integration tests) - these test against the HTML/JS that is returned by our app, but sometimes also tests other things, like calls to third-party services. RSpec controller tests (functional tests), originally only if the controllers have any meaningful logic, but now more and more. RSpec model tests (unit tests) Sometimes this is entirely necessary; it is necessary to test

What are the best practices for testing “different layers” in Django? [closed]

强颜欢笑 提交于 2019-11-27 09:05:10
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm NOT new to testing, but got really confused with the mess of recommendations for testing different layers in Django. Some

Why use JUnit for testing?

倖福魔咒の 提交于 2019-11-27 09:00:07
问题 Maybe my question is a newbie one, but I can not really understand the circumstances under which I would use junit? Whether I write simple applications or larger ones I test them with the System.out statements and it seams quite easy to me. Why create test-classes with JUnit, unnecessary folders in the project if we still have to call the same methods, check what they return and we then have an overhead of annotating everything? Why not write a class and test it at once with System.out but

TDD vs. Unit testing [closed]

我怕爱的太早我们不能终老 提交于 2019-11-27 08:59:08
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . My company is fairly new to unit testing our code. I've been reading about TDD and unit testing for some time and am convinced of their value. I've attempted to convince our team that TDD is worth the effort of learning and changing our mindsets on how we program but it is a

Can unit testing be successfully added into an existing production project? If so, how and is it worth it?

落花浮王杯 提交于 2019-11-27 08:56:13
问题 I'm strongly considering adding unit testing to an existing project that is in production. It was started 18 months ago before I could really see any benefit of TDD (face palm) , so now it's a rather large solution with a number of projects and I haven't the foggiest idea where to start in adding unit tests. What's making me consider this is that occasionally an old bug seems to resurface, or a bug is checked in as fixed without really being fixed. Unit testing would reduce or prevents these

Is there hard evidence of the ROI of unit testing?

做~自己de王妃 提交于 2019-11-27 08:55:54
问题 Unit testing sounds great to me, but I'm not sure I should spend any time really learning it unless I can convince others that is has significant value. I have to convince the other programmers and, more importantly, the bean-counters in management, that all the extra time spent learning the testing framework, writing tests, keeping them updated, etc.. will pay for itself, and then some. What proof is there? Has anyone actually developed the same software with two separate teams, one using

How do you know what to test when writing unit tests? [closed]

落爺英雄遲暮 提交于 2019-11-27 08:55:48
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . Using C#, I need a class called User that has a username, password, active flag, first name, last name, full name, etc. There should be methods to authenticate and save a user. Do I just write a test for the methods? And do I even need to worry about testing the properties since