Dariusz on Software Quality & Performance

09/04/2014

Computers's helping hand

Filed under: en — Tags: — dariusz.cieslak @

grub

08/02/2014

Self-signed SSL certificate HOWTO

Filed under: en — Tags: , , — dariusz.cieslak @

logo_sslSSL is used for (1) encrypting HTTP traffic and for (2) authentication server against browser's database of trusted certificates. Generating SSL certificate properly is important if you want your customer to use https properly. It costs few bugs per year, but your customers won't have any warnings in browser before SSL session (purpose number 2).

However, for internal applications, self-signed certificate may be a sufficient solution (purpose 1 only). You will find below a minimal commands to generate local SSL certificate (accept default values when asked for data on stdin):

mkdir -p /etc/lighttpd/ssl/local
cd /etc/lighttpd/ssl/local
openssl genrsa -passout pass:1234 -des3 -out server.key 1024
openssl req -passin pass:1234 -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -passin pass:1234 -in server.key.org -out server.key
openssl x509 -req -in server.csr -signkey server.key -out server.crt
cat server.key server.crt > server.pem

Then lighttpd installation:

$SERVER["socket"] == "<YOUR_IP_ADDRESS>:443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/ssl/local/server.pem"
ssl.ca-file = "/etc/lighttpd/ssl/local/server.crt"
}

Then you have to accept server certificate in your browser and voila!

06/02/2014

OVH VPS Classic Review

Filed under: en — Tags: , , — dariusz.cieslak @

I'm a very happy Linode.com (an US VPS supplier) customer and my expectations regarding service quality are pretty high. VPS is a virtualization technique that allows to share the same hardware among few operating systems with dedicated IP and root access. Having migration to another server in mind I've decided to give a try our European VPS providers.

One of the biggest hosting providers is OVH. I hope those French guys do better hosting services than cars :-)

Minimum VPS offer is reachable for 5 EUR + VAT / month. It gives you only 512MB of RAM:

307

(more…)

07/01/2014

QUnit – Unit Testing made easy for JavaScript

Filed under: en — Tags: , — dariusz.cieslak @

Are you test-infected?  Learned already how to grow your server-side apps using unit testing and want to do the same with client (HTML) layer? Search no more! QUnit to the rescue!

289

QUnit is a JavaScript library that helps you with tests specification, run and diagnostics. Firstly, you have to include qunit library and your tests in an html file:

<html>
<head>
<link rel="stylesheet" href="/resources/qunit.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="/resources/qunit.js"></script>
<script src="/resources/tests.js"></script>
</body>
</html>

Then you can start writing your tests, the simplest one, taken from documentation:

(more…)

22/12/2013

Classic Testing vs Design By Contract

Filed under: en — Tags: , , — dariusz.cieslak @

Automated unit tests are hard to write. Software architecture must be designed carefully to allow unit testing. You have to spend time to write tests as well and it's not easy to write good tests. It's easy to make big mess that is hard to maintain after few weeks.

On the other hand automated integration tests are hard to maintain and are fragile. You can "write" them pretty easy in a record-and-replay tool, but later they show their real cost during maintenance.

But there's an answer for problems mentioned above. Do you know Eiffel language? The language has special built-in constructs that support executable contract specification. It's called Design By Contract (DBC). DBC is easier to write and to maintain because no special test cases need to be specified, just conditions for method parameters, expected results and state invariant that must be preserved. How DBC can substitute old-fashioned tests? Read on!

(more…)

« Newer PostsOlder Posts »

Powered by WordPress