Programação dia a dia

sábado, 7 de julho de 2018

Using GPU processing to optimize your applications


Nowadays CPUs have a high processing capability, and you can benefit from its multiple cores by using parallelism to your applications. There are several frameworks that allow you to do this, like for example the Task Parallel Library (TPL)
But you can go further by using the GPU. General-purpose computing on graphics processing units (GPGPU) might be the solution if you need to perform very heavy processing. Just like your CPU might be a dual- or quad-core device, GPUs can host several hundred or thousand cores. You can use all this power to not only calculate graphics but also arithmetic operations.

To unleash all this power there are several frameworks:

However, if your working experience is mainly with high level programming languages, and you don't have much Algebra knowledge, you might find it quite complex to start on this world, and to identify how you can benefit from all this processing power.

There are several applications of this technology. It works the best performing simple operations, in big amounts of data, were all threads are performing the same operation. 

terça-feira, 17 de abril de 2018

CAKE! What is it?

Do you know what CAKE is? Not for eating :)


It allows to write build scripts in C#. Typically build configurations (from TFS, Team City, Jenkins, ...) are technology dependent and are not under source control. Not with CAKE.


Nice blog explaining its usage.
https://codeopinion.com/automating-builds-with-cake-c-make/

terça-feira, 27 de março de 2018

Why to use containers and Kubernetes?

I am sure you have been hearing a lot about containers and Kubernetes. But what are they? For what use? Can they really be used in production or are just a "toy"?
It happens that your can google it to learn more about it. Unfortunately most of the information you will find is quite abstract, or right away too technical, or is more like the slides of a manager of some consulting company that just wants to sell something to someone that just wants to buy something for the company they work for in order to justify a promotion because they will b able to make a nice presentation with some nice buzz words on it.

Scott Hanselman is great on making complex topics understandable. And here is a good example on containers.

Improving your drawing skills

I always struggle on expressing myself to drawing. Here is the prove :)

However there are people that do it quite nice and easy. I think I will try to lean from them.

quarta-feira, 21 de março de 2018

Are your test cases polluted with object instantiations?

You should consider using the builder pattern with the fluent syntax. A good example from the good google testing blog.

Company small = newCompany().setEmployees(2).setBoardMembers(2).build();

I have used it myself in a C# project and it is really useful as you ensure you build always valid objects, it has a high code reuse, and is very readable.
But of course there are some challenges, like what should be the default values of such objects? It is very difficult to achieve that your tests will not turn red when you modify one of this default values  under the hood (or like the British say, under the bonnet :) ).
Even thought the builder pattern is an alternative to the mother pattern at some point you will need some combination of both in order to create some quite different types of objects. Or... can it be that it is a code smell? That if this happens is because the production code is not respecting the single responsibility principle?
Also, in C# you achieve the builder pattern by using extension methods, that of course you will need to implement and maintain.

Nevertheless I highly recommend using this pattern in your tests. I know no better alternative.

quarta-feira, 14 de março de 2018

Is BDD simply about test automation?

I just found out that at some point in time I was a BDD pervert :)

I was reading a very useful article about the correct usage of BDD. Some anti-patterns are mentioned, and I found out I was falling in at least one of them: "Automation is a side benefit — not the reason to do BDD".

It happens that I was using Specflow, and thinking that just because of that reason I could say I was doing BDD. Wrong! Its clear that achieving a higher quota of automated tests is one of the benefits, but you don't have to automate all your scenarios.
Also the origin of the scenarios was not the best. The scenarios were sometimes scenarios written by the tester, from interpreting the requirements.
There were also some scenarios were coming from the product owner without much interaction with the team.
From the technology point of view, Specflow was sitting on top of our end-to-end testing infrastructure. If it is correct that is another discussion. 
BDD is much more than automating tests, it is about conversations between the "three amigos" (business, development, testing). They need to sit together from the beginning. You should go through concrete scenarios. This way you will clarify the expectations everyone has, uncover wrong assumptions, and hunt bugs even before they are born.

sexta-feira, 9 de março de 2018

Cucumber (Specflow in .net) vs. Robot Framewrok

In a previous blog I mentioned my finding on KDT (Keyword Driven Testing).

A famous framework is Robot Framework. I could avoid seeing its similarities with Specflow, but a little more complicated to integrate as you will my be introducing another programming language to your project. In Robot Framework you will be programming your keywords and functionalities in Python.

Well, I was not the first having this question. I could find a very nice answer to my questions.
Also a comparison.

Seguidores

Contribuidores