Which layer should my JBehave acceptance test target in a DDD application? - unit-testing

Given a DDD application with a hexagonal architecture, which layer should my JBehave acceptance tests target?
I want to write Features and scenarios as specifications for the overall system behavior as we are introducing ATDD as our development process.
In my application I have these layers:
Presentation layer
Web services layer
Application services layer
Domain layer
Infrastructure layer

Generally JBehave is seen as unit testing framework for Behavior-driven development, which I think will combine well with your current design
we are introducing ATDD as our development process
So as bottom line - it's strongly recommended to have unit tests for all app levels, but I think that especially in the case of JBehave, it will be helpful if you use it not only in your Presentation, but also in Application services and Domain layers too.

Related

Test framework for multi-layered application html5/sql/c++

I am an experienced c++ developer, but I have not spend much work in design of applications. Question:
I am working on an existing application that consists of the following layers
HTML5 front-end
Database that communicates with the front-end via stored procedures
Back-end c++ application running on Linux servers that communicate with the database via a job-daemon
We want to introduce more automatic testing into the application. We want full end-to-end tests, as well as individual tests on each level, i.e. test of front-end, test of SQL stored procedures, and test of back-end.
Is there some kind of unifying framework where I can setup tests across all layers? And e.g. a board that provides overview of test results.
Thanks in advance!

Automated Unit Testing Oracle BPEL SOA projects

Is there an alternative to the Oracle SCA Unit tests provided with JDeveloper for testing SOA projects/BPEL?
The problem I have is with it is the amount of effort required to write the tests through the clunky UI and the smallest change will invalidate all tests currently built which makes them un-maintainable.
The other issue is due to the graphical interface the SOA composite must first be written before unit tests can be written meaning a test driven-development is not possible.
The final issue is the emulation functionality is incomplete with database partner links.
I use SOAP-UI to perform unit testing. I create separate test scripts with SOAP-UI which allow me to generate a number of different test case scenarios which can be targeted at individual services.
I then invoke these from a Jenkins/Hudson script to provide continuous integration testing.
In this way you can do your TDD without first creating the composite.
With your database partner links you can emulate them either with a stub composite or alternatively with SOAPUI. This depends on what your configuration is and exactly what you use the data for.

ecommerce application web tier/presentation layer unit testing

We have had some success using selenium and web driver along with Jbehave. just wanted to know what others are using for unit testing the web tier of any web application?
the reason i am asking is , writing web driver test cases along with jbehave makes the unit testing very complicated and in more cases, it is taking more time then writing an actual JSP page.
A few ideas for unit testing a web tier:
Use MVC for doing web development. It is pretty easy to unit test controllers assuming you extract all your dependencies.
Make liberal use of interfaces to extract dependencies in your JSP pages. For example, does your JSP make a database call? Consider making an Repository interface and then have implementations like MySQLRepositoryImpl.java that implement the interface. This way, you can also "mock" the interface and create a fake database that will run fast in your unit tests.
For very difficult problems where you absolutely need to use a dependency, you can get embedded versions of things like web servers (Grizzly, Jetty) or even databases (H2, SQLite).
Make sure you write your code such that each function does one thing and one thing only. This will take some refactoring, but it makes testing so much easier.

how do you use TDD for developing webservices using Oracle Service Bus

Does anyone have any opinions on how TDD and UNIT testing would would when developing web services using Oracle Service Bus? All I can think of is stubbing out the back ends then running tests through the service bus, but that's really just integration testing. How would I apply TDD principles in this instance?
Is your question actually how best to conduct unit tests on Oracle Service Bus components? I have the same issue but have come to the view that now your unit of code is not a Java method or a class but a whole proxy.
It does however limit you to being only able, at best, to conduct component integration testing as you have described: Stubbing out the other systems and running what you'd traditionally call Integration tests through the Service Bus.
Scale up your unit of work.
If there is a better way to automate and test these code artifacts then I want to hear about it.

Is JBehave a good choice for Web Service Automated Testing?

We have a requirement at my workplace to automate the webservice testing. We have been using QTP scripts to do so.
We as a team, Kind of leaning towards Jbehave as a choice. Is JBehave a good choice for web service functional testing automation?
We do use Soap UI to test manually. But we are planning to automate the functional and regression testing to reduce the release cycle time.
Suggestions welcome.
It may not be possible easy to implement load (performance) tests. Can't see any reason why writing functional and regression tests would be a problem.