Friday, June 19, 2026

This blog went quiet after 2016. I never stopped building, I just stopped writing here.

Since the Java Missionary days I've spent 10 years in Java and distributed systems, and these days I build AI-augmented engineering workflows, then measure whether they actually work.

My writing has a new home: https://lenikirilov.com. Same focus on engineering, now with the data to back it up. If anything here was useful to you, that's where the new material lives.

Thanks for reading. — Leni

Sunday, July 24, 2016

Microservices mishaps: 1 query, multiple DBs

I want to share my experience with the latest trend in software engineering - microservices.

In particular, I want to explain a case I recently stumbled upon which made us hate the strategy we've got of splitting the big monolithic application to microservices.

The use case is relatively simple - one wants to make a query concerning multiple entities. They have relations between them nevertheless, the data ideally should be owned by separate microservices in an autonomous way.

The example:

Let's say that the product is a ERP-like and naturally we would have entities like company and invoices. Naturally, we'd went for microservice for the company - let's name it company-srv and one for invoices - invoice-srv. Both of these should own the APIs and DB

Now what happens when we want to make a query that is something like:
Get all companies with more than 1000 invoices
or slightly more complex example:
Get all invoices that haven't sent email-report last month for the companies that have this feature enabled.

How do you handle such responsibility - is it in invoice-srv's ownership and it should have a dependency on the other services? How do you keep the performance high with increased row count?

Even if you handle this with additional relations between the 2 DBs between the autonomous services, let's add another more interesting factor to the situations.

The more complex (and quite common) example:

Let's try to intertwine permissions - let's say that the user who is trying to see the results of the above queries, doesn't have permissions for some of the companies? Or even more intriguing - for some of the branches of the companies...

Whose responsibility is it to orchestrate the query? Does it become a multi-query operation? Is there going to be a permissions-srv ? What about performance?  Pagination?

...

All these are questions we ask when we pick microservices. Otherwise, it would have been a simple JOIN in the monolithic approach....

Are we going backwards? :)

PS:
more on the topic this cool post: https://www.javacodegeeks.com/2016/07/hardest-part-microservices-data.html 

Friday, June 03, 2016

Old projects reborn - MoneyTimer

This is another tool, I've tried to update in order to withstand the test of time - MoneyTimer

What does it do ?
It measures time and calculates every second how much time it costed all participants.
Great for consultation meetings!



You can try out the latest release here:

What I can learn from it?
- Java 8 Lambda expressions
- Simple Multi-threaded application
- Swing

How to contribute: 
Check the instructions at the github repo page.
If you are wondering what to contribute: there's a list of ideas in the issues page


Tune in, because more complex ones are coming ...

PS:
Check out my other project that can interest you. This time about HTML generation via XSL transformations - http://javamissionary.blogspot.bg/2016/04/old-projects-reborn-filesystem2html-tool.html

Friday, April 29, 2016

Old projects reborn - FileSystem2Html tool

As everyone in the IT business, I have quite a few of my own projects. Most of them rot in solitude and are rather dusty... So, I decided as a way of exercise as well as a check how have technologies developed and my own views on code cleanness, tests' quality and overall project usability, to make them more development-friendly.

In short - I'm reviving my projects (both university and personal ones) so that they are easy to setup, run and contribute to if there's a willing person.

I'm starting with this small project: https://github.com/leni-kirilov/FileSystem2Html/

What does it do:

- it's a simple Folder structure scanner
- it can build an HTML/XML report of the folder structure
- it can rebuild that folder structure elsewhere (without the content, obviously)

My "beautiful" swing UI

Very useful if you like a certain folder structure, and don't have the time to remove all the files or whatever. You can easily mimic it. Quite a simple app.

Now to the contribution part:

- It's an open source project 
- Java 8 required
- built with Maven 
- a list of TODOs and ideas where one can get started! I've listed ideas based on effort. 
I would start with the small ones. 

The project builds automatically and measures code coverage (yes, there are unit tests there!)
(Thank you Travis-CI, Coveralls and Coverity!)

So that's pretty much it.
I can't wait until I see someone energetic about such a tool

Best of wishes!
Leni

PS:
Please be gentle :) I know there's some pretty lame code out there!

Tuesday, July 28, 2015

Gradle Daemon - boost your build performance

You use Gradle and want to speed up a bit your build time? Nobody wants to wait for compilation, assembly etc. Let's try this easy to setup performance boost:

If you enable Gradle Daemons, you can actually reuse the Gradle context that you've just created for your subsequent builds! It basically doesn't completely kill the process when a Gradle build finishes, but reuses the common framework classes and thus improving build time.

I've tried it on my projects and the improvement was from a 40s build down to 20s on subsequent builds !

Here's what you need to do and know:
touch ~/.gradle/gradle.properties && echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties

  • enables Gradle daemon for all your projects by default (don't worry you can turn it off for individual projects as well)
  • if you use multiple Gradle versions, a different daemon is created for each one! This is a potential deal-breaker for some developers, but a good reason to align all your projects to a single version of Gradle.

  • in case you want to recreate the daemon, you can stop them all using:

./gradlew --stop
And that's it!

For more info check the dedicated page:
https://docs.gradle.org/current/userguide/gradle_daemon.html 

Monday, June 29, 2015

Chocolatey - apt-get for windows

As a Windows user, I was quite envious of Linux/OS X tools like apt-get or brew... But not anymore!  I've just found the Chocolatey tool for Powershell which let's you easily find and install software on your Windows-powered PC.

Let's see an example:
Searching for Slack and installing afterwards





















This way you can maintain apps and versions on your PC using scripts.
If you want to check if there's an upgrade to any of your programs, just write:

choco upgrade all
If you want to give it a try yourself, visit https://chocolatey.org/  and follow the instructions

Wednesday, June 03, 2015

Traveling back in time

What happens when you go to your parents' house is that you
travel back in time...

It's strange to see all the playgrounds that were once full with kids
and laughter, covered in bushes and trees, so high that makes you
understand just how much time has passed...

You remember times when you laid the foundation of a new football field, nothing of it still remains.
Even the goals are removed and most probably melted as scrap...

Having looked through the window for just a minute, made me travel back in time 10+ years.
And that makes me understand just how insignificant life is, as well as how visible and how powerful it can be - life passed by me and this playground very quickly, events occurred and had a long-lasting effect. Events most probably defined by life ... like those very lively trees that now occupy those grounds!

Entropy, such a short word but describing so many things...
...
A great way to get out of my negative entropy-based chain of thoughts, is to reread Isaac Asimov's "The Last Question". I just love his work and this is one of his best, in my opinion.

Friday, August 15, 2014

Automatic code coverage badge / reports for Java 8 project in Coveralls.io

Recently, I've setup a Java project hosted on Github to get automatically build using TravisCI. It's super cool to have a nice badge saying that your recent builds are green. But then I discovered I could have some more report using free tools like TravisCI.
For example - code coverage tool like Coveralls.io

This is where it got interesting quickly. It's written on the official site that it supports only dynamic languages but nothing about Java. But a quick search in Google pointed me to a maven plugin which connects with Coveralls' API. So I decided to give it a try.

Here are some useful links and hints for everybody trying to do it for his own project:
  1. Check if your project is Java 8If it is, you have to use the JaCoCo maven plugin, since this is the only code coverage tool supporting Java8 compiled classes. Use at least version than 0.7.0  (according to this bug report)

  2. Configure it your pom.xml to use JaCoCo
    You could use the snippet here but with newer JaCoCo version
  3. Configure in your parent pom.xml to use coveralls-maven-pluginCarefully read the README of the plugin. For security reasons don't publish your token on your repo.
  4. Update .travis.yml to try to upload your coverage report to Coveralls.io
    after_success: mvn clean test jacoco:report coveralls:jacoco
  5. Add cool coverage badge to your README
    Like this one:  Coverage Status

    Congratulations!
    You've succesfully integrated: Github + TravisCI + Coveralls.io + JaCoCO for a Java 8 Project

    Check out my example project which has successfully integrated all these wonderful systems. https://github.com/leni-kirilov/MoneyTimer

    Kudos to Tapio Rautonen for creating such a useful plugin and documenting it in an excellent way! 

Friday, June 07, 2013

Eclipse and maven-properties problem

Today, I'm going to share a problem which I think it's quite common:
- importing Java Maven projects into Eclipse and expecting Eclipse to just work with it.

You do:
1) sync from source control
2) import existing maven projects to eclipse
3) see many red errors in Eclipse.
4) yeah , I forgot to set the Maven settings file
5) still some projects are failing
6) try to fix each problem 1 by 1

Why does it happen like that?

Most common is that it will set a Java Compiler version which is from the POM.xml but then the JRE environment specified could be... just not right. So your POM.xml says "compiler version 1.7", but the Maven projects you import are automatically assigned Java1.5...
So errors like
- You cannot use @Override here
or for java1.7
- new ArrayList<> constructor not found (or not valid expression).

So you have to go to each project, reconfigure build path parameters to point to JRE1.7 manually, even though you have specified JDK1.7 as installed JDK.
Imagine fixing this manually for 20-50 projects (you've just been moved to moderately progressed project)

Even if you explicitly set the Maven settings in the Preferences menu, you would not solve your problem.

The single solution is to:
1) delete all projects ( only from Eclipse )
2) reimport them, because NOW you have set the Maven settings BEFORE the importing...

Just crazy... not being able to automatically adapt the projects to the new maven settings file... not even "clean" and "maven update" help...

Best wishes,
Leni Kirilov

Tuesday, September 18, 2012

Powershell - the good and the bad. The story of a survivor.

Today's topic is Powershell - it's usefulness and weirdness.

It is the Microsoft super cool console which is used to provide command-line API for all of MS big products like Office, SQL Serveer, etc. It is build on top of .Net so every .Net class you write, you can take advantage of it in the command-line.

It has it's advantages:
- using objects and not strings for pipelining commands
- the .net framework
- ease-of-use - with just a few commands you can open up the Powershell world.
- very readable
- good help about_xxx articles

Let's start with the
Good Stuff

Pipelining is a powerful feature. You can pass multiple result objects from 1 command to the next one just like this:

How you delete everything inside a folder ?
Get-Item "c:\folder\" | Remove-Item -Force -Recurse #alias is dir or ls
How to see how to use a command ? What are its parameters? What does it do?
Get-Help "Get-Item" -Full  #alias is man or help 
What are the properties/methods of a process ?
Get-Process | Select-Object -First 1 | Get-Member #alias is gm

With just Get-Help (or man), Get-Member (or gm) and Get-Command (to list all available commands/functions/aliases) , you can do anything!


You'll use pipelining all the time! It's really cool!

Some nice hits are:
- filtering a collection of items by a property. Returns all folders with name ending with the string "project"
$folderList | ? { $_.Name -match ".*project" }
which is short way to write:
Foreach-Object $folder in $folderList | Where-Object {  $folder.Name -match ".*project"}

- doing a repetitive task on many objects. Display

$folderList = dir | ? {$_.GetType().Name -match ".*DirectoryInfo.*" }
$folderList | % { Write-Host "$($_.Name) - $($_.CreationTime)" }
- errors
When there is an error just get the automatic variable $Error (array of error objects) and check the last 5 errors $Error[0..5]


Main usage of Powershell is doing some quick check on something in the Microsoft infrastructure or writing a script to automate a routine tedious task like creating a report or killing all not-responding processes at the moment.
Overall system administrators will love it.
...

and here ends the good things... If you try to use it for something else, you'll hit many different obstacles:

Strange behaviour

Functions want to return something!

In fact, every function you call that returns an object, and the result is not saved in a variable, is automatically transfered as a result. OK, but when you have multiple such calls inside your function, these results are added into an array and here's the /unexpected behaviour/...
function myFunc(){
 Get-Process
 dir
}
$b = myFunc
$b.GetType()  --- #it says array

The other way to stop this from happening is to enclose the call with brackets and [void] the result like this:
 [void] (Get-Process)
The strange empty array

When comparing empty array to $null  with the comparison operator -eq (equals), doesn't return neither $true, nor $false...just ... nothing.

This is partially explained with the Powershell ability to auomatically flatten an array to its elements. When it's an empty array - the operation doesn't execute. But there's no error as well... or warning.

Try this:
@() -eq $null
and
$null -eq @()
Also if you are used to separate each function parameter with comma, you will have a hard time!

Using comma ( ,) will generate an array. Well, Powershell likes arrays a lot, and you will, too, but only after the initial struggle.


Using it for plain programming

Unfortunately, when you want to use it to code features, and even small frameworks, you hit

some obstacles like
- Visual Studio doesn't support it... at all! No other IDE with satisfying experience, too
- PowerShell ISE isn't feature-rich enough
- only suitable is Notepad++ with word completion and many macros along the way...
- no compile-time catching bugs like - unused variables, or undefined ones...


Unfinished or just plain broken features


Modules as Custom objects

As of Powershell v2, there is a new method to package commands (cmdlets) - modules (instead of snapins).

So you can import modules into the runspace or import them as CustomObject, which has
methods as the functions declared in the .psm1 file (module script file)

These CustomObjectModules are very buggy when it comes to multiple imports and generating exceptings...Trust me. The latter is very nasty...
I
magine writing a few modules which should use each other - common utils, etc. And then you have an exception. Now where exactly did the exception occur ? Try to get catch it with try-catch - the Error record contains only the row/execution line of your current module in development! Nothing about the inner exception or error stack... !! Which is not useful at all.

In order to be productive with these modules, I ended up writing my own ExceptionStackTrace building function which collected errors, line numbers, positioned the stack trace correctly, and stops when it reaches another stack trace (.Net one) which is descriptive enough...  Well, I'm sure it could have been done better, but it works stable enough and I like that it solved this problem which should have been handled by the Powershell Team!

Also nested imports fail from time to time with functions which cannot be found...
I am seriously, not going to use Modules as CustomObjects anymore... Too bad. Almost like Object-oriented programming... but with serious issues...

Remoting
While Powershell provides nice API for remote calls - Invoke-Command for executing single scriptblock and Enter-PSSession for interactive mode. They are thought quite nice, but unfortunately, the last few weeks I've come to the conclusion that they are quite fragile and I was often the observer of the following results:
- OutOfMemory Error
- Stopped execution without errors
- WinRM was not configured correctly errors pointing to articles in MSDN which weren't specific enough.


So basically here are my findings about Powershell Remoting:

- complex requirements for remote machine for the remoting to work. Not a single full guide for this.

- adding snapins remotely for machine with no Internet access - 2 minutes ! You have to turn off the Internet Options > Advanced > Security option to "Check for publisher's certificate invocation" and it will pass in seconds.

- remoting stops without any error or logs. Hard to debug. Could be missing configurations/rights, could be low memory

- slightly more complex remoting produces many errors. For example starting a new resource-hungry process on the remote machine results in OutOfMemory Error. Solved by increasing the memory per PowerShell property described at the end of the article.

- inconsistent behaviour - different errors for unchanged code

- lack of documentation for some of the features - only a few blog posts saved me a few hours/days

A few tips here:

- the remoting script you run should be as light as possible and should just execute a file/script located on the remote machine. This was you can lower remoting data transfers(logs, commands, variables, etc)

- for complex, time-consuming tasks use Invoke-Command xxxx -AsJob parameter. This way it will create invisible background thread, which will take even less resources. Actually, for my complex scenario , it proved to be the only working option...

Get-Item wsman:localhost\Shell\MaxMemoryPerShellMB 
Set-Item wsman:localhost\Shell\MaxMemoryPerShellMB 512 -Force

Conclusion:

Don't get me wrong. Using Powershell is overall an easy and straight-forward experience, but when you try something a bit more kinky and ... let's say that the 'fun' starts there.

Best regards,
Powershell-ill
Leni Kirilov

Tuesday, June 19, 2012

Be efficient - virtualize and automate your test infrastructure

Author: Leni Kirilov, PowerCLI QE team, VMware Bulgaria

I met my friend Michael, a software quality engineer, who is validating the functional correctness and completeness of “Cake Wizard”. Cake Wizard is an online store, consisting of a database of items for sale, accounts, online payments, etc. It is an enterprise application developed with JEE.

In the process of validating the product, Michael needed a dedicated test environment. Michael told me he created a complete set of automation tools for executing the tests, gathering the results, and reverting the environment to its initial state. He was really proud of his accomplishment. He also integrated download and installation of product builds with a Git source control system for the test cases, Jenkins/Hudson for scheduling jobs on the test run process, and a custom test runner to execute JUnit… I was impressed! Michael had done a really great job by automating so many things. But he mentioned that he had many problems with automating the process. There were even lost test run results due to bugs.

I suggested a different approach – automation & virtualization. Michael looked confused, not to say surprised. “But virtualization is used only in production systems for better load-distribution, resource utilization and cloud services… what does it have to do with automation testing?” I smiled…

Nowadays, most testing looks like this: you get a physical environment, execute tests on it, and revert it to a clean state by using images. This approach is convenient because you don’t have to configure everything all over again. But there are some negatives as well.
- When you modify the hardware configuration, you must update the image, because it’s hardware specific;
- If the hardware configuration fails, you can lose all your data and test results, which is a potential risk for the project.
- The approach doesn’t scale well because a single hardware configuration can be at most a single test environment.

Virtualization has the same advantages as images-driven test environment setup and more:
- Better utilization – you can run more than one virtual machine (VM) on a single piece of hardware as long as there are enough resources. Provide your Quality Engineers their own environment to play with!
- Revert to a previous state – cleanup is easy because VMs are designed with that in mind. You can easily debug a problem by using snapshots. They are quite fast, too.
- Hardware failure – it’s irrelevant for the virtualized infrastructure. Since VMs are just files, you can back them up, in order to minimize loss, in case of server crashes
- Pool of resources – no need to reconfigure and recreate images when you buy new hardware. You just add it to the pool of resources.
- Maintenance & automation – with minimal effort you can replicate VMs by using virtualization and the already available automation scripts. You can even create your own automation scripts!

My friend Michael heard my arguments but was still skeptical. He had already created his environment and he asked me: “What’s the easiest way to virtualize it? What are the first steps?”

Let’s see how easy we can use VMware virtualization to:
- automate setting up a test environment,
- set up the test software
 - collect test results



[Set up and configure virtual test environment]


You need virtualization infrastructure, so let’s install VMware ESXi Hypervisor. It provides tools to run and manage virtual machines. Follow these instructions
You start your virtualized test environment by creating a empty virtual machine (VM). You install the OS (Guest OS) and applications you need just once and save the result VM. You can use it to clone and thus multiply the VM as many times as you need.
Let’s install Windows Server 2008 and a JBoss Application Server 6 on our VM and name it “Manually created VM”.

Manually configuring a VM is OK only in the process of learning the VM specifics. As Quality Engineers, we want to automate as much as possible in our work.
“How do we automate a virtual test environment and what is the best tool?”
The preferred tool for virtualization automation is VMware vSphere PowerCLI. It is closely developed with the VMware infrastructure suite (called vSphere). We need only some of the many features which PowerCLI provided, to create our test environment. The product platform is Microsoft PowerShell (running on .Net) – powerful yet very user friendly CLI (command line interpreter) which provides great console commands(called cmdlets) for managing other Windows products like SQL Server, IIS, Windows, MS Office etc. Even though PowerCLI is based on Microsoft technology, you can use it to install and configure Windows, as well as Red Hat Guest OS on your VM. Let’s see it in action:

Download and install latest PowerCLI version from here: http://www.vmware.com/go/powercli

To start using PowerCLI you should connect to your local VMware ESXi Server (which you should have installed and configured beforehand).

Connect-VIServer 192.168.1.1 -User ‘administrator’ -Password ‘pass1234’
#For later processing get your VM and store it in a variable.
$vm = Get-VM –Name “Test_Environment_VM_1”
Start-VM  $vm # you can start using your VM for configuration
It’s highly recommended to install VMware Tools on your VM – it makes some of the trickier operations possible, improves VM’s performance…
Let’s get all network interface cards of the OS installed on the VM and then configure them.

# get all network cards. GuestUser is the username required for login to the GuestOS
$nics = Get-VMGuestNetworkInterface $vm -GuestUser ‘administrator’ -GuestPassword ‘pass1234′
We have dedicated the 192.168.2.* subnetwork for our test infrastructure, so let’s update the VMs IP and DNS addresses:
Set-VMGuestNetworkInterface $nics[0] -Ip 192.168.2.2 –Dns 192.168.1.2 -GuestUser ‘administrator’ -GuestPassword ‘pass1234′
If you need a more advanced configuration for your Guest OS, you can take a look at the OSCustomization cmdlets, which give you the ability to configure user accounts, active directory, workgroups as the VM is created. There are examples in the documentation.

After you finish configuring your networking, you should create a snapshot that saves the state of your VM. This is useful when you want to revert this VM to a previous state. Let’s create a snapshot for future use:
New-Snapshot –VM $vm –Name “After network configuration – 2012.02.20”
[Create environment configuration files]


It’s good to keep various data about your environment. We create a hashtable called $env1. It can store the names of virtual machines, the servers’ IP addresses, DB table names, etc.

You can use the NIC objects to build this configuration file for future test executions or to form a report. The $nics variable contains all the information you need such as IP, DNS, Subnetmask, etc:
$env1[“IpAddress”] = $nics[0].Ip
You can save the hashtable $env1 to a file and use it as configuration for your “execute test” script. This way you can easily switch between environments with various properties.
$env1 | Export-CliXml “d:\CakeWizard\Testing\Environments\env1_win2008.xml”
#to use the configuration you import it using this call:
$env1Config = Import-CliXml “d:\CakeWizard\Testing\Environments\env1_win2008.xml”
Now you can combine all these one-liners in a short script that configures VM’s networking and creates a report/config file with the current IPs that are in use.

Simple, huh?

“What about applications and integration with other systems like Source Control Repositories or test execution systems like Hudson/Jenkins?”

[Set up tests and test framework]


For even greater customization, you can execute custom scripts in the Guest OS! By copying files to the Guest OS and executing them, you can automate the following action:
- downloading and installing the software under testing;
- syncing sources with tests and frameworks;
- preparing reports;
- managing Microsoft products via their PowerShell API;
- pretty much everything you can think of!

You can copy different executable files, ZIP files with scripts, DLLs… everything you want, to the VM’s local file system. Let’s sync the tests from our source control repository. I’ve written a short script to create workspace and sync everything with it.
Copy-VMGuestFile -LocalToGuest -VM $vm -Source “d:\CakeWizard\tools\sources_sync.bat” –Destination “c:\CakeWizard\tools\perforce_sync.bat” -GuestUser “administrator” -GuestPassword ‘pass1234′
#execute the script we’ve copied
Invoke-VMScript -ScriptText “c:\CakeWizard\tools\sources_sync.bat” -VM $vm -GuestUser ‘administrator’ -GuestPassword ‘pass1234′
The ScriptText parameter can point to another script or be the script itself. So that makes it pretty easy to be included in Hudson/Jenkins job.
The script you execute returns live results to your screen while working inside the VM. This is great for monitoring the progress of a long test run or analyzing test run results. The best thing about the Invoke-VMScript cmdlet is that it can execute many types of scripts: Powershell, BAT for Windows and Bash for Linux systems!
Now that we’ve prepared everything, it’s good time to create another snapshot. Let’s name it “Ready for test execution” or “Clean state”.

[Install product]


Let’s upgrade to the latest build version of our product. We have a Powershell script that does the job. Let’s see how to execute it:

Invoke-VMScript -ScriptText “c:\CakeWizard\Tools\upgradeProduct.ps1″ -VM $vm -GuestUser ‘administrator’ -GuestPassword ‘pass1234′
[Create report]

You can generate a test run execution report after the test execution. Our report holds information about the test id, test status, log files and execution times.

Invoke-VMScript -ScriptText “c:\CakeWizard\Tools\generateReport.bat” -VM $vm -GuestUser ‘administrator’ -GuestPassword ‘pass1234′ 
# locally copy a report
Copy-VMGuestFile -GuestToLocal -VM $vm -Source “c:\Tests\Results\Report\*.*” -Destination “d:\TestResults\Report\*.*” -GuestUser “administrator” -GuestPassword ‘pass1234′
[Clean up environment / Revert to snapshot]

When you run a test (again, you can use Invoke-VMScript to trigger execution), you might pollute your brand new Test_Environment_VM_1. Wouldn’t it be great, if you could always go back to a clean state of your test environment? This way you can be comfortable with running even the deadliest, most insane, build-crashing tests. Our new script for creating a new test environment could do the trick, but there’s an even easier way to fix the ruined VM – snapshots!

# reverting the vm to a previous state
Set-VM  –VM $vm –Snapshot “Clean state”
“Set up once – test multiple versions!” 


You can easily customize these one-line scripts for your own use cases. By combining all of the scripts, you will automate your virtual environment! You are just a step away from provisioning multiple test environments!

[Copy VM to create a new virtual test environment]

A VM is just a set of files, so we can copy a VM by copying its files. Let’s create a new environment called “Test_Environment_VM_2”.


#change directory to ‘vmstores:’. It gives you access to the datastore tree.
#navigate to your datastore and Test_Environment_VM_1 location and copy it
cd vmstores: 
Copy-Item “.\Test_Environment_VM_1” -Destination “Test_Environment_VM_2” –Recurse
#now let’s register the new VM
New-VM –VMFilePath “[datastore_name] .\Test_Environment_VM_2\Test_Environment_VM_2.vmx” –Name “Test_Environment_VM_2”| Start-VM
And you are ready with your new environment and John can help you with testing “Cake Wizard”

Note – there is an easier way to clone a virtual machine – check VM templates, a feature available in vCenter Server.



Virtualization makes your testing process quite agile and scalable – you can create more VMs on which to run tests, than the number of the physical machines you can buy or power up. Even your developer colleagues can use the VMs for developing the software in the first place!
You can also easily revert a VM to a clean state, without losing any time for configuration.
You can set up and configure the VM so that most of the things that you can do with a physical machine are possible (except for testing specific/special hardware devices).
You will no longer fear of hardware failures, because your VM can be automatically migrated with no downtime.

You can automate all these tasks with the highly-rated tool – VMware vSphere PowerCLI.

Well, Michael, I think that now you understand the advantages of virtualization in testing. As quirky as this concept sounds, you’ll find that the basics are not that different from the classical approach. Do you have any other questions, we can discuss over a cup of coffee?

Sunday, August 21, 2011

Javascript - the things which make me dislike it

Hi

My experience with Javascript is at novice level but on the project I had to use it for,
as a Java developer I couldn't have noticed the following problems:

1. No spell-checking

This is a dynamically typed language meaning that it cannot auto-complete and cannot be type-safe
because you cannot know a variable's type before runtime. You can assign any type to 1 variable after its initialization...
Also it cannot be checked when you wrote "connectoin" when you actually meant "connection" and
you will get a null pointer error only at runtime...

2. Low IDE support

There is no IDE for Javascript. You basically use an editor that can highlight words (Notepad++) .
You make your own discoveries at what helps you fight with writing Javascript code.

3. Debugging is not cool

Today's browsers have integrated debugging tools for web-pages and generally Javascript but nevertheless it's still not as comfortable as setting breakpoints and then following the execution one step at a time.


Those are the few things that got me basically away from Javascripting ...

If you don't agree with my points, feel free to provide arguments against my theory.

Best regards,
Leni Kirilov 

Saturday, August 20, 2011

A diffrent software architecture - LMAX

It was an interesting afternoon to read the article that the famous Martin Fowler had written a month ago.

It's about a different kind of architecture, how it worked and how the software engineers got to that solution of their problems. The project is about processing multiple concurrent orders and the platform had to provide low latency. The team managed to create a system that copes with 6 million transactions per second.
The strange thing is that they do it on a single-threaded application with in-memory database approach (caches).

They have tried other more-conventional approaches like multi-threading and the Actor approach but the performance of the Queue was limiting them, also the need to synchronize threads and interactions between them, context switch at CPU level was drawing performance back.

So they decided to separate input/output and processing into different modules.
Each input event gets unmarshalled and all its required pre-processing (IO operations and credit card verification operations for example) are done before hand and inserted into a the main stream that is processed by the business logic unit.

The team also create special implementations for collection classes so that they use caches better. They processed events not in a Queue approach but with a ring buffer and on it were running several processor modules - one for unmarshalling, one for backup (Journal) and Replicator and finally the Business Logic Processor. They are in a constant race and there are rules that prevent 1 from getting ahead of the other and processing a data field that isn't ready yet. This ring buffer has enormous size (20 million items)

The main idea is that CPU can process fast sequence of operations which are simple (therefore very optimized by the Java compiler), and using in-memory caches (no SQL queries), this could push the performance of a system high.

Also another gain for the team is that they don't have to cope with complex techniques like transactions, inter-thread communications etc...


I think I've just covered the basics of this software architecture approach. If you are interested enough, do visit the original article at -> http://martinfowler.com/articles/lmax.html

Tuesday, October 19, 2010

DevReach 18+19 October Sofia, Bulgaria (part7)

22...continued

Dynamic State Storage Using the ASP.NET Provider Model

Interesting session about creating a storage for an application and making it with a unified interface.
Dealing with problems when you have same kind of storage collections.
Using the isolateUser, isolateProvider.

Nice design for his library.

HTML5 and CSS3

SVG vs Canvas
SVG is slower for animatons
Canvas is not suitable for low number of items which can be interacted with

-ms ; -o ; -moz ; -webkit ---- these are specific for certain browser, default is used otherwise

LESS - JS library that reduces and makes CSS easier when supporting different browsers
Modernizr - make your site supporting older browsers (IE6 >)

Recognize older/new browser --- the property "autofocus" -- tricky attribute

CSS3 can put round edges for rectangles; 3D shadows; rotate images ... lots of nice animation


Anti-patterns 
DRY principle - Don't Repeat Yourself
Assumption Driven Programming - don't assume something instead of asking the user
Dependency Injection principle
The God class - the one great class that does everything



L.K.

DevReach 18+19 October Sofia, Bulgaria (part6)

...continued

HTML 5 crash course


HTML 5 is connected with everything that is modern and flashy today. 
Introduction of iPad is in the same day as the HTML5 introduction.
Adobe vs Apple conflict.

"Apple is becoming the most important company in the US"

www.html5rocks.com - some tricks, a site recommended.

Browser vendors love HTML 5 because they don't want their products to be 'old'.
HTML 5 is pushed into the history.

HTML5 is not ready yet. It's good

The sad facts:

60% of Internet is used with IE6, IE5 and IE7 - they don't support HTML5.
60% Windows XP
15% still use IE 6.
91% of the browser users use Windows - they have the grip

Silverlight updates are quicker - they are pushed with automatic updates with Windows.

In his oppinion "Html 5 > 4"

www.html5test.com - test the browser about html5 support
Chrome - 217 + 10 bonus
IE8 - 27 + 0 bonus
Opera 10.61 - 159 + 7 bonus

Microsoft will never get 100% for ACID3 test because they don't want to support SVG fonts.

Syntax:
HTML5 template is with a DTD... nobody validates it with a DTD. "A pain in the ass" - quote.
AJAX was never specified.... they reverse-engineered it.
HTML5 has a spec - that makes it a lot different. The error behaviour consistent.

He simplified the HTML5... - charset, language, DTD validation - cleaner.

New semantic tags:
Old way - meaningless IDs for "div" tag
Google statistics : code.google.com/webstats about names of ID
They took the statistics and used the mostly used words and make them special words. They made the best practices rules in HTML5.

WebMatrix - interesting free tool for building web sites. Part of the WebPlatform. It's a direct competitor to PHP.
Razor + MVC  --- "in a 6 months will be the hottest thing"

"Microsoft's primary goals this year - Azure, IE9 and HTML5"

Modernizer - javascript lib for audio
html5shim .code.google.com -- javascript for adding HTML5 tags to IE6 (which doesn't support it)

html5 - audio tag
html5boilerplate - best add-on pack for html5

"Silverlight version of video is adaptive to the broadband width"

Google created a site to refer to for fonts instead of distribute them in your own site as a local copy.

L.K. 

DevReach 18+19 October Sofia, Bulgaria (part5)

...continued

Designing Applications in the era of Many-core Computing:

This session was about making a unparalleled program use all cores of a CPU.
The presenter was a Romanian so his program was the recipee for making goulash.
He used threading on a higher level with a structure called a Task.
A tasks can be combined to be one after another by a lambda expressions.


Building RESTful Applications with the Open Data Protocol

The last session I attended was one regarding RESTful services.
The presenter was very high-spirited and it was a joy to listen to his explanations.
So REST services is exposing a service to be accessed  via pure URL address through the browser. 
Using the HTTP methods POST GET UPDATE DELETE to access the service if you have the access rights.

He demonstrated how to connect to such a service via a client.

He created an REST service. 
He showed an easy API to do paging for the service.

It was a very nice presentation. 

L.K. 

Monday, October 18, 2010

DevReach 18+19 October Sofia, Bulgaria (part4)

...continued

Easing into Windows Phone 7 Development

 The presenter : "How many of you hade a Windows Mobile device"
.... some hands raised
he: "I'm sorry." :)

Fair enough...

BUG: Oops, first Windows Phone 7 glitch - the hold of search button didn't make the menu came up.

For developers:
deveoper.windowsphone.com
Expression Blend 4.
Has a good emulator
You need a developer account for 99$ from Microsoft to unlock your phone, to debug your device.
You need Zune to connect to a device to test your application.

NOT GOOD: There is a 10 application limit... you have to uninstall some of your applications that you are developing...
That sounds like a pretty bad deal...

BUG: He said himself he found a bug. After a few application deployments, it says it can't deploy more applications and it gets fixed when you disconnect the USB cable and reconnect it again.
This is getting more and more interesting...

The memory usage cap - 90 MB of processing memory space.

PROBLEM: But using more memory produces strange exceptions following his words... he lost a lot of time until he thought of checking the memory usage.

There are dark/light theme for the Windows Phone 7.
He showed that it's easy to adapt your application to the theme.

Changing icons automatically when theme is changed - use AppBar.
- app bar is like a pop-up menu or the drag-menu in Android , but it's inside the application.

The emulator can be rotated in horizontal mode and rotates the icons with nice motion.

He raised the question:
- how do you display tooltips when there is no mouseOver event?
Well, his suggestion is design and for example wait for a few seconds and make a label visible.

Panorama - a huge background image which is automatically moved depending on the count of the items in the panorama.

Different sets of keyboards are available - chat keyboard, normal, etc

L.K.

DevReach 18+19 October Sofia, Bulgaria (part3)

...continued

.Net tips and tricks

1. SQL injection prevention
<%: ... %> -- for ASP.net and it prevents SQL injection etc
Use it instead of <%=...%>

2. Trace it
-- better for debugging

add as a attribute in the page xml ->  
Trace=True 
makes the other traces to be colored in red


3. Caching
http://tinyurl.com/c275vt - Update Callback

He's showing some web caching with load testing.

<% OutputCache ... - he increased the performance for a page showing database entries from 25 requests/sec to 250 req/sec.

4. use IDisposable when net using WCF
http://tinyurl.com/az52gy
and "using()"

5. Action / Func keywords for lambda
Don't Repeat Yourself - principle :) We know it. Nothing new.
Action is for better logging.

6. Extension methods:
Search for some extension methods to improve given sites. 

7. Testing different vesions of configurations
custom config sections


8. WebForms - don't use Labels too much
9. WebForms - ViewState - be careful with its usage
- move the viewState to the bottom of the page because of bots collect a few thousand bytes from a page to scan it. Put your data to the top!

10. Some tools he uses everyday
LinqPad - linqpad.net
Reflector - reflector.red-gate.com - similar to Java Decompiler - see the source of a class file
FireBug - for Firefox
Fiddler - for IE
ViewState Decoder - http://tinyurl.com/2msmev


L.K.

DevReach 18+19 October Sofia, Bulgaria (part2)

...continued

Internet Explorer 9
Roman Russev from Microsoft Slovakia is speaking about it.
fast / clean / secure / interoperable

He takes notice of the new open policy of Microsoft - the open beta releases of Win7, IE etc

Interesting features are like pinning pages from IE directly to the taskbar of Windows7.


Visual Studio 2010 Light Switch
It's all about data and screens.
It's a tool for not-developers to create business applications - making it easier.

First step - "choose a language, you can decide how are you going to deploy it later"
Next step - describe the data for the application

It looks very point-n-click.

Next step - building a screen. Just adding a template hooks the data with the look.
Many out-of-the-box stuff added like - search bar, ribbon, tabs etc...

Looks pretty nice to have all these and not work hard to implement them.


L.K.

Sunday, October 17, 2010

DevReach 18+19 October Sofia, Bulgaria (part1)

Expect my comments about DevReach, .net technologies and cloud computing.
I know this site is about Java and technology but I see it as a good opportunity to check what is the competition going to present to the public.

Expect updates!

--

Registration went smoothly. I'm eagerly expecting the beginning of the keynote in the 13th hall.

Interesting facts:
- 2010 is the 5th DevReach and it has double the speakers, sessions and attendees than the first DevReach back in 2006.

- There will be a prize for the first registers - a free Visual Studio 2010 Ultimate


Vertigo's CEO is talking about User Experience.
He's presenting lots of sites that are streaming video.
A new Jay-Z's book has a site written on Silverlight - with lots of video, maps etc - very awesome.
Keynote "You have to learn about design!"

5 important areas for design:
- Industrial design
Surrounds us; he's talking about showers - Desing + Intent ! Everything is meant with a reasaon. "Observe and ask yourself why!"
"Developers, we are very good at accepting bad user experience. We can adapt. Common user can't."

- Usability
Jakob Nielson
How long does it take you to accomplish your goal?
"Honestly, people don't care about software" :)
"Don't make me think" - by Steve Krug --- about easy usage of products
"You could be embarrassed  by testing your product with real users..."

-Typography
Fonts fonts fonts
They can make your intention wrong or extremely right and immersive.
He explains the curves of fonts... He says that the emptiness is more important than the black ink part of a letter.
Helvetica is his favourite font.

-Natural UI
-Motion graphics

Introduction of mouse - not as intuitive as touch screens! The presenter's daughter got confused... nice example!
Touch - become interesting when iPhone came out.
"Nobody wants a 15 000 $ coffee table..." :) Funny guy is making us laugh.

Oh my god!
He's showing us Windows Phone 7 and its intuitive UI
"You are not using Helvetica" :) - nice point!

Key concept is a caption (text) which is partly cut out of the screen and it MAKES you to slide to see the rest of the application.

L.K