Functional testing and Acceptance testing leading to redundant code

What I know is:

  • A Functional test aims to test a single component (like a WebApp’s Controller) from the point of view of the developer. => Did I achieve all the requirements to make it work well?
  • An Acceptance test aims to to test a group of components together and is focused on the Business point of view. => Does my program fulfill requirements provided by the Client/Business/Customer?

Today, I work on a personal project and I started following BDD/testing methods and thus created Acceptance tests and Functional tests.

I notice that a lot of requirement for functional tests are exactly the same that Acceptance tests need.

Suppose a webapp controller aiming to add a product to my e-commerce’s basket.

One of concerned functional tests would be:

When I go to productList.html page and I call the addProductToBasket action, I expect my controller to retrieve the right quantity and the right product
name, and expect my view to display it.
(very generic)

Surely, Business would expect application to behave the same way a developer had written in some of its functional test, so in this case, an acceptance test would be:

Given Bob enters in the product list page, when he clicks on the
button “addToBasket” near to the “Nike basket n°2” product, basket
should display quantity ‘1’ and “Nike basket n°2”
. (specification by example)

Both tests are very similar, aren’t they?

So my question is: Do we risk to create a lot of duplication code and redundant tests while creating functional and acceptance tests in parallel?

What is a good practice? Making functional test carry about some pure technical things only, like exceptional/buggy behaviours, inconsistent variables scenarios etc… and let acceptance tests deal with the whole business scenarios side?

I would even say: Is functional testing really needed when we attach a huge importance to acceptance test?

yes, there can be duplication. Often with line of business type websites, you find the acceptance tests can actually substitute for developer oriented tests, because the depth of code needed to implement features is not too great. As a comparison, image recognition software may have huge depth, but at an acceptance level it might be simple as needs to recognize this as a circle, and this as a square. Developer wise, you need to test your image capture, light correction, object detection, object recognition, blah blah….

So if you have a shallow amount of code between acceptance and implementation, it quite often does feel redundant.

However, there are a few other differences in terms of process. You can have a suite of acceptance tests build up, and they don’t all have to pass all the time, they can act as targets, so you go from 5% passed, to 10% to 50% etc, until you knock all the tests off. In some cases, ideally these tests can be put together semi independently of the developer. Developer oriented tests, the intention there is to have them passing all the time.

4

Yes, Tests should exist at multiple levels, in multiple forms and yes, you will see a lot of redundancy.

For example in a MVC you may have test in all three places that are checking on the value of an attribute. This can be seen as as a positive thing because then you can change any piece and know the effect of the change.

So yes, as you mention the different tests should test different things. Database tests can exercise CRUD operations and check the results, middleware can be tested similarly and can be used to actually drive the development (TDD).

Front-end tests can make sure that the user actually ends up seeing the intended results, regardless of the vagaries of output devices and versions.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật