Category Archives: Uncategorized

Weekly readings #2

This are my recommended readings for this week.

 

muppetspairprogrammingA good introduction to pair programming. Probably one of the more overlooked programming technics but with no doubt one of the most effective ways to guarantee quality code and improve the technical skills of a team.

http://www.infoq.com/articles/introducing-pair-programming

 

 

Roman Nurik posted in the Android Developers Blog a good check list to port our existing Android apps to the new Material design style.

http://android-developers.blogspot.co.uk/2014/10/material-design-on-android-checklist.html

 

This is a nice one for the vintage code lovers and specially if you want to see how the C language code looked like 20 years ago. From the Computer History Museum in Mountain View you can download the source code of the Microsoft Word for Windows Version 1.1a.  Love it!

Screen Shot 2014-11-08 at 14.23.03

Microsoft Word Version 1.1

http://www.computerhistory.org/atchm/microsoft-word-for-windows-1-1a-source-code/

 

This one is a video from the Google Developers community on Google+ that remarks how important is to have our app indexed on Google search.

 

And finally a free book from Google entitled “The Secrets to App Success on Google Play”.

https://play.google.com/store/books/details?id=GJ0kBQAAQBAJ

Weekly readings #1

This is the first of a series of posts just to share interesting things I’ve read during the week related to Software Development, not exclusively about mobile.

In this post on ADMag, David Ramel explains how a couple of studies found that mobile apps are failing to provide the user proper information about how and what personal data might be collected and how it would be used:

http://adtmag.com/articles/2014/09/15/apps-fail-on-privacy-and-security.aspx

 

Peter Bright comment on this post a security hole discovered on WebKit, the open source engine used on the native Android browser. Basically it allows malicious websites to inject JavaScript code into other websites.

http://arstechnica.com/security/2014/09/android-browser-flaw-a-privacy-disaster-for-half-of-android-users/

 

Really interesting report about the status of the Android platform, fragmentation, devices and version statistics and good tips for the Android developers.

http://www.smashingmagazine.com/2014/10/02/what-every-app-developer-should-know-about-android/

 

A nice article about good practices and tips on Android testing.

http://testdroid.com/testdroid/5876/test-early-test-often-testing-as-part-of-your-app-development

 

And finally some advices about code reviews.

http://blog.salsitasoft.com/practical-lessons-in-peer-code-review/

Test Driven Development (TDD) with Google C++ Testing Framework and Visual Studio (III)

And first of all, why should I use Google Test Framework?  There are several reasons to choose Google Framework between other options and you can find out more about it on their website, but I’ll give you two of my reasons:

  • It’s designed to be portable. You can use it on Windows, Mac and Linux and I can use it on Visual Studio and Borland Builder C++. That’s cool.
  • Automatically detects your tests and you don’t have to set specifically wich tests must run.

Ok, let’s start downloading the framework from here.

Unzip the gtest file and put it in the Visual Studio Projects folder or in any other folder where you have your projects. You’ll see several folders, each one belongs to a different platform. In our case we’re going to use the Visual Studio’s framework, so go inside the “msvc” folder, open the gtest solution and compile and then follow the steps:

  1. Create a new console test project with Visual Studio and C++ language.
  2. Add to this solution the projects “\msvc\gtest” and “\msvc\gtest_main” of the “gtest” solution that we compiled before.
  3. Go to the project Properties and in the Configuration Properties > C/C++ > Code Generation set “Basic Runtime Checks” to “Both (/RTC1, equiv. to /RTCsu) (/RTC1)” and set “Runtime Library” to “Multi-threaded (/MT)”.
  4. In this Properties page, set the “Optimization” option to “Disabled”.
  5. Also in  Configuration Properties > C/C++ >General > Additional Include Directories add this line “$(InputDir)\gtest-1.3.0\include” for All Configurations (Relese/Debug).

Ok, now add a new .cpp to our Test Project, for example “TestBattery1.cpp” where we are going to write our first Test using an example that you can find in the Google Framework website, which defines three steps:

  1. Include necessary header files.
  2. Use the TEST macro to define your tests.
  3. Call RUN_ALL_TESTS() in main().

In this code example, we test the function Factorial. You can find the function here and the tests code in this link:

// Tests factorial of 0.
TEST(FactorialTest, Zero) {
EXPECT_EQ(1, Factorial(0));
}
// Tests factorial of positive numbers.
TEST(FactorialTest, Positive) {
EXPECT_EQ(1, Factorial(1));
EXPECT_EQ(2, Factorial(2));
EXPECT_EQ(6, Factorial(3));
EXPECT_EQ(40320, Factorial(8));
}

And that’s all for today.Finally, I leave here  a very good book about TDD but in this case with C#:

http://www.amazon.com/Professional-Test-Driven-Development-Applications/dp/047064320X/ref=sr_1_2?ie=UTF8&qid=1323605071&sr=8-2