Mostrar mensagens com a etiqueta Unit Testing. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta Unit Testing. Mostrar todas as mensagens

quinta-feira, 2 de abril de 2020

Unit Testing: cmocka - unit testing framework for C

A unit testing FW for Embedded? Yep.
Details here:
cmocka - unit testing framework for C



Quoting:

"

cmocka is ...

an elegant unit testing framework for C with support for mock objects. It only requires the standard C library, works on a range of computing platforms (including embedded) and with different compilers.

"




terça-feira, 19 de dezembro de 2017

TOOLS: Mocking Frameworks (and testing tools) for Java programmers (LIST)

The 8 Useful Java Testing tools (& Frameworks) for Programmers, Developers and Coders

Listed above, 2 mocking frameworks for Java:

"Mockito

Mockito is designed as a open source testing framework for Java which is available under a MIT License. Mockito allows programmers to create and test double objects (mock objects) in automated unit tests for the purpose of Test-driven Development (TDD) or Behavior Driven Development (BDD).

Powermock

PowerMock is a Java Framework for unit testing of source code and It runs as an extension of other Mocking frameworks like Mockito or EasyMock but comes with more powerful capabilities. PowerMock utilizes a custom classloader and bytecode manipulator to enable mocking of static methods, removal of static initializes, constructors, final classes and methods and private methods. It as been primarily designed to extend the existing API’s with a small number of methods and annotations to enable the extra features.
It is available under an open source Apache License 2.0 and is available in Powermock Google Code site."

terça-feira, 5 de dezembro de 2017

BOOK: Art of Unit Testing, Second Edition (Roy Osherove)

To see the TOC:
https://www.amazon.com/Art-Unit-Testing-examples/dp/1617290890

2 free chapters:
https://livebook.manning.com/#!/book/the-art-of-unit-testing-second-edition/chapter-4
https://livebook.manning.com/#!/book/the-art-of-unit-testing-second-edition/chapter-1/45

Quoting:
"About the book
You know you should be unit testing, so why aren't you doing it? If you're new to unit testing, if you find unit testing tedious, or if you're just not getting enough payoff for the effort you put into it, keep reading.

The Art of Unit Testing, Second Edition guides you step by step from writing your first simple unit tests to building complete test sets that are maintainable, readable, and trustworthy. You'll move quickly to more complicated subjects like mocks and stubs, while learning to use isolation (mocking) frameworks like Moq, FakeItEasy, and Typemock Isolator. You'll explore test patterns and organization, refactor code applications, and learn how to test "untestable" code. Along the way, you'll learn about integration testing and techniques for testing with databases.
(...)
The Art of Unit Testing, Second Edition guides you step by step from writing your first simple tests to developing robust test sets that are maintainable, readable, and trustworthy. You'll master the foundational ideas and quickly move to high-value subjects like mocks, stubs, and isolation, including frameworks such as Moq, FakeItEasy and Typemock Isolator. You'll explore test patterns and organization, working with legacy code, and even "untestable" code. Along the way, you'll learn about integration testing and techniques and tools for testing databases and other technologies."

ISBN: 978-1-933988-27-6

quinta-feira, 30 de novembro de 2017

TOOLS: Mocking Frameworks for .Net Developers (LIST)

Top 5 Mocking Frameworks for .Net Developers

Quoting:
"What is a Mocking Framework?
Mocking framework is used to create replacement objects like Fakes, Stubs and Mocks. It is used to isolate each dependency and help developers in performing unit testing in a concise, quick and reliable way.
Creating mock objects manually is difficult and time-consuming so to increase your productivity you can go for automatic generating of mock objects by using a mocking framework. A developer can build his/her unit test by using any of one NUnit, MbUnit, MSTest, xUnit etc. unit test framework and can further test it on a mocking framework."

The list:

  1. http://nmock3.codeplex.com/SourceControl/latest
  2. https://github.com/FakeItEasy/FakeItEasy/
  3. https://github.com/moq/Moq/
  4. https://github.com/RhinoMocks/RhinoMocks
  5. http://nsubstitute.github.io/

sexta-feira, 26 de maio de 2017

SW Construction | SW Testing: best practices

Here are some interesting considerations (do you agree on all of them?) about coding AND testing, with additional links to books and/or articles every good boy (read: every engineer) should read:

https://opensource.com/article/17/5/30-best-practices-software-development-and-testing

segunda-feira, 21 de novembro de 2016

DIGEST: SW Construction - Further Reading

Additional Resources for SW Construction:

While building your software (aligned with the gathered requirements - SRS - and the software design that your high-level architecture defines - SAS) several additional topics are relevant. For instance: Coding standards to comply with (if any); comments to create and % of comments and eventual traceability to requirements IDs / component ID there left; static analysis to perform (and extracted KPIs to comply with - if any); continuous integration server and tasks to use; verification measures such as unit tests, code reviews. For more generic information on these topics see here.
   
For further detailed information please see the following links (some are INTERNAL).

Static Analysis
  1. http://silvaonsoftware.blogspot.pt/2016/05/tools-source-monitor-static-analysis.html
  2. http://silvaonsoftware.blogspot.pt/2016/05/tools-static-analysis-tools-listing.html
  3. http://silvaonsoftware.blogspot.pt/2016/10/sw-construction-static-analysis-tools.html

Code Reviews: 

  1. The QMS context (INTERNAL): Review Procedure here; Crucible Tool GBK hereCheckStyle (Java) tool GBK here.
  2. Code Reviews example - Crucible (Plugin to JIRA; INTERNAL): https://crucible.critical.pt/cru/ATG-5#CFR-11408

Continuous Integration (CI):

  1. About CI, a list of several servers available can be seen here: https://en.wikipedia.org/wiki/Comparison_of_continuous_integration_software
  2. Example - Jenkins (INTERNAL): http://jenkins.critical.pt/computer/(master)/ (INTERNAL; Teamcity could also be in use for some projects).

Unit Testing

  1. Think "developer tests" (and see Module 9 for now; again, INTERNAL)

Further reading - Coding Standards: 

Each company might have internally defined coding standards. Or it could be using external standards (e.g. HP, NASA, ESA, etc.). Google for "C Coding Standard" and see what it is meant by coding standards here: For instance this is 1994 NASA-SEL's style guide for C (PDF).

Further reading - BOOKS: 

There are lots of books on SW Engineering that focus on best practices for coding activities, with the objective of writing clearer code, easier to understand and maintain, easier to reuse, etc. 

Two must read examples might include: 
Many more books have full chapters on writing "good" code. 
Again, "Google" and/or "Amazon" for it.
Happy readings!