--
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriented-software+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.
I adhere to your way of thinking => preferring to test with an end-to-end vision while it is possible.
As the project just kicks off, client comes and presents its expected first feature (it's an example): List on the page the most active 5 users of my website.
By practicing BDD, he sends me:Given I am on the home pageWhen I click on "top 5 users" buttonThen corresponding users are displayed as a list
Given the users
| User Name | Visits in the last Month |
+-----------+--------------------------+
| Alice | 10 || Bob | 5 || Carol | 12 || David | 40 || Eve | 23 || Frank | 0 || Grace | 12 || Harry | 4 || Ivy | 7 || Joe | 18 |The most active users are shown to be:| User Name |+-----------+| David || Eve || Joe || Carol || Grace |
On Sunday, 16 June 2013 13:50:03 UTC+1, Michael Azerhad wrote:I adhere to your way of thinking => preferring to test with an end-to-end vision while it is possible.I don't always prefer to test end-to-end. It's a trade-off -- an engineering judgement. Usually testing against the domain model is fastest and most reliable. But sometimes (e.g. early in the project) the cost of modularisation isn't worth it and I like to address integration risks as early as possible. And sometimes (e.g. in projects with a large integration aspect) the domain model doesn't always cover enough of the complexity for acceptance tests against the domain model to be very meaningful.
On Mon, Jun 17, 2013 at 1:34 AM, Nat Pryce <nat....@gmail.com> wrote:On Sunday, 16 June 2013 13:50:03 UTC+1, Michael Azerhad wrote:I adhere to your way of thinking => preferring to test with an end-to-end vision while it is possible.I don't always prefer to test end-to-end. It's a trade-off -- an engineering judgement. Usually testing against the domain model is fastest and most reliable. But sometimes (e.g. early in the project) the cost of modularisation isn't worth it and I like to address integration risks as early as possible. And sometimes (e.g. in projects with a large integration aspect) the domain model doesn't always cover enough of the complexity for acceptance tests against the domain model to be very meaningful.Thanks Nat and Steve and Michael,this thread is very useful.My 2 cents of experience in helping people that are new to testing at all is that they will sometimes spend hours wondering how to test some piece of technical infrastructure like e.g., JSF beans or Spring-injected databases. I then suggest to apply some variation of Humble Dialog/Humble Object to get the most interesting bit of the code under test with a very easy-to-write and quick-to-execute unit test. I explain that at this stage, writing a true end-to-end test is not as important as being able to comfortably test the interesting bits. I also stress that when something is hard to test, it's better to decouple the production code than to learn more fancy concrete-class-mocking techniques.
Automating every acceptance test as an end-to-end test is not always the best option. It could be because the tests will be to slow, or because it is hard to test through the UI etc. When (all) acceptance tests are not automated as end-to-end tests, for instance they are automated against the domain model,
- We want acceptance tests, to agree on the spec for a feature and to verify that the feature works as intended
- We want end-to-end tests, to make sure that all parts of the system works together as a whole
IMHO, testing use-cases directly (without coupling with boundaries like UI or database), as Uncle Bob promotes give the illusion to be more productive.IMHO, if you are already sure about your technical boundaries, testing end-to-end may be longer to implement and to run, but it compensates the wasted time by manual testing before a delivery (with the stress that comes with it). "My SQL query crashed !! Why this menu doesn't appear on this page ?! " etc.. Many things that could be catch earlier by taking in account UI and Database in your acceptance test.I imagine also a company which knows a huge turnover.. what will be the reaction of new developers: "huh.....what does this screen is about to do?, I want to change the way of listing elements, it's ugly .. " " Nooooo, don't touch, we haven't test to ensure the modification".According to me, after thinking a lot about it, if you have time, do end-to-end test. Of course, this end-to-end test would not prevent a design with loose coupling between boudaries and use-cases/domain layer.
Objections about end-to-end tests and testing through the GUI, even from TDD advocates, seem to be about post-hoc testing, in which the system is a fixed thing and tests exist only to check it. But I find that if you use system tests to drive the design of the system you get useful design improvements that simplify interfaces (even UI) and drive the design of monitoring and management interfaces that help support the system when deployed.
--
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.
On 17 June 2013 13:36, Nat Pryce <nat....@gmail.com> wrote:Brittleness: ene-to-end tests use all of the 'moving parts' of your application (including infrastructure). System tests ensure that all these components play together nicely. Acceptance tests demonstrate that specific application functionality has been delivered. Why expose your acceptance tests to the risk of intermittent/transient failures? Or to put the other way - what's the benefit of doing this?
... I chose to start to implement the feature by creating a unit test of my "future" controller (I use Play framework). So, UserControllerTest is firstly created, leading to create a UserServicesImplTest.Implementation of the UserServicesImplTest is totally trivial, mocking a UserRepository returning an empty list. Of course, I create also a real UserRepository dealing with a simple NoSQL request to find Users. This latter will be call by the end-to-end acceptance test.I make UserServiceImplTest passes easily and then UserControllerTest (containing a mocked UserServicesImplTest in order to be truly isolated)(I agree that a real TDD procedure doesn't know anything about layers at the very beginning... but in order to speed up a little, I allow me just this step jump.)
--
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.
Understood for layers :) I will follow a pure TDD procedure so, letting my code to emerge them, if happens, without anticipating them :)And I agree, customers may not even know what is a database.. :)Thus, why do we qualify the walking skeleton to be "end-to-end"?
Should I rather deal with in-memory storage (simple POJO for instance) in order to be more flexible to future decision (deferring storage choices) if my TDD makes emerge the need for a storage?
Why the choice of UI implementation, like GOOS presents with a Swing interface, is made at walking skeleton time? Why this choice should not be deferred, like database should?Can't I say: "Customers may not even know about kind of UI interfaces"?
By "end-to-end" terms, I understand the notion of concrete mechanisms…not really just a simple "understanding" of necessary components…I'm a bit confused so :)Thanks Nat :)
On Tuesday, June 18, 2013 2:45:59 PM UTC+2, Nat wrote:On 17 June 2013 01:23, Michael Azerhad <michael...@gmail.com> wrote:... I chose to start to implement the feature by creating a unit test of my "future" controller (I use Play framework). So, UserControllerTest is firstly created, leading to create a UserServicesImplTest.Implementation of the UserServicesImplTest is totally trivial, mocking a UserRepository returning an empty list. Of course, I create also a real UserRepository dealing with a simple NoSQL request to find Users. This latter will be call by the end-to-end acceptance test.I make UserServiceImplTest passes easily and then UserControllerTest (containing a mocked UserServicesImplTest in order to be truly isolated)
(I agree that a real TDD procedure doesn't know anything about layers at the very beginning... but in order to speed up a little, I allow me just this step jump.)No! :-)You're missing the fundamental aspect TDD if you start by thinking up a load of layers and patterns, write tests that assert that code fits that design and then write code to fit into the design that's now concreted in by your tests.Really try to start with the *smallest* test that you can. Try to write the *simplest* implementation that makes the test pass. Let structure emerge by refactoring. As structure emerges choose meaningful names that expresses how the code relates what the system's users do and how they talk about the work. You may be surprised as to the design that emerges. E.g. maybe there will be no classes named ThingyImpl, WotsitService or GizmoRepository.For a start, how do your users or customer(s) refer to users of your system? As a user base? A user population? Cohort? Community? I bet they don't say "User Repository"!
The point of a walking skeleton is to help you understand the *external* integration points between your system (and team) and the other system's (and teams) you need to integrate with. That may be third-party services, operations teams, network monitoring infrastructure mandated within the organisation, etc. etc. I would not include a database component that's fully under your control and that you deploy as part of your app in a walking skeleton. That's just an internal implementation choice that one can very often defer until later.--Nat--
http://www.natpryce.com
--
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriented-software+unsubscribe@googlegroups.com.