Migrating from Extjs to React gradually

Migrating from Extjs to React gradually

We were looking for a few alternatives to our big ExtJS 4 application. Since it’s not that easy to completely migrate from one front-end framework to the next, a possible solution would be to start developing new parts in another framework. There’s a lot of domain logic spread in Ext views and controllers - which shouldn’t be there, we are well aware of that. Let’s call it “legacy” :-) The application right now uses Extjs as UI and C# as backend, and lets ext do the loading of the views/controllers (living in app. Read More »

Webdriver Exception Handling

What should you do when something goes wrong with your scenario tests

As the previous post indicated, we’re trying to stabilize our scenario tests created with WebDriver. One of the things we did was trying to capture as much data as possible if something goes wrong. Something like a typical ElementNotFoundException, or the less common StaleElementException (detached from DOM after evaluation) - these things can be hard to trace if you don’t run the tests locally. We also stumbled upon the “it works on my machine” problem - tests succeeding on one development machine but not on the other - mostly related due to timing issues. Read More »

Unit Testing Extjs UI with Siesta

An attempt to replace instable Webdriver tests with Siesta UI tests

WebDriver & js-heavy frameworks Writing scenario tests for javascript-heavy UI webpages can be really difficult. It gets complicated pretty quickly if you’re using a lot of async calls or a lot of javascript-heavy UI components. On our current project, we use Extjs as the UI layer in a single-page aspx page to bootstrap our Extjs app. Extjs is a (heavyweight) javascript framework for creating windows, panels, grids, buttons, menus, … like you’re used to when using client/server desktop applications. Read More »

.NET Memory management VS JVM Memory management

Increasing your maximum heap size in .NET? Tough luck.

Memory management is something to keep in mind when deploying and running applications on top of the JVM. Parameters like Xmx and Xms are things to juggle with when it comes to finding the perfect balance between too much memory hogging (at app startup) and too little, especially if you’re working with heavy duty entity mapping frameworks like Hibernate (and you’re not so good at writing fast HQL). When we bumped into an OutOfMemoryException in . Read More »

Faking domain logic

Using C# extensions to create the illusion of domain logic

Sometimes, life is just a little bit more difficult than you imagined the day before. Sometimes, you have to work on a legacy codebase with custom frameworks rooted so deeply you’re having lot’s of trouble trying to build around them. To make it a bit more concrete, here’s an example: imagine a separate DLL for interfaces and a separate DLL for the implementation. This decision was made because we use NHibernate as a data mapper and not to write beautiful domain driven design code. Read More »

Custom Webdriver Page Factories

Wrapping WebElements to reduce boilerplate clutter

The problem: Webdriver elements returned by driver.FindElement() are too generic. There’re the Text, SendKeys() and Click() methods/properties (depending your on C#/Java implementation). The solution is to simply wrap all elements inside custom HTML objects which contain specific methods like ShouldContainValue or Type (okay, that’s a one-to-one mapping with SendKeys(), but it’s a lot less technical!). Instead of [FindsBy(How = How.CssSelector, Using = ".ux-desktop-taskbar-startbutton")] private IWebElement startButton; [FindsBy(How = How.CssSelector, Using = ". Read More »

Bye autotools hello Scons

Building C++ projects with Scons

Remember this? ./configure make make install That’s not so bad, as long as you have the right compiler and linker flags configured, depending on the target OS. The real problem, however, is trying to figure out how to alter something if you didn’t write the Makefile yourself. Or if you in fact did write it, but it was some time ago. Two days. No, four hours. The problem Try to study the autoconf and automake flow diagram, explained on Wikipedia: the GNU build system. Read More »

Metaprogramming instead of duplication

convention over duplication, good or bad?

So… What’s up with all that duplication in your unit tests? Let’s take a look at a very recognizable pattern when for instance using RhinoMock in C#: [TestInitialize] public void SetUp() { dbConfigurationMock = MockRepository.GenerateMock<IDbConfiguration>(); mountPointLoaderMock = MockRepository.GenerateMock<IMountPointLoader>(); userEnvironmentFactoryMock = MockRepository.GenerateMock<IUserEnvironmentFactory>(); userEnvironmentLoaderMock = MockRepository.GenerateMock<IUserEnvironmentLoader>(); // ... We agreed to suffix each instance variable with ‘Mock’ if it’s a mock. That way, when you scroll down to an actual test case, it’s clear to everyone what’s what: mocks, stubs, actual implementations, and so forth. Read More »

Enhancing the builder pattern with closures

the trainwreck/builder/chaining pattern can be dangerous and here's why

This post is inspired by Venkat Subramaniam’s Devoxx 2013 talk Thinking Functional Style. See downloads at agiledeveloper.com which has a rather cool Groovy example. Classic builders For years, I’ve been using the builder pattern to quickly create new objects to be inserted into the database or to inject our domain objects with the required data. We started with so called “Object Mothers”, static methods which simply create and fill up an object, passing in a huge amount of parameters. Read More »

Integration Testing with SQLite

Decoupling your integrated database environment from your development.

This article is based on the notes I’ve collected on My Wiki. On previous projects I’ve worked on, development PCs came with a local version of the database scheme. Each DB change also got rolled out to those computers, which enabled us developers to fool around without breaking anything on the development (or test) environment. This is another step closer to happiness, at least for our proxy customers who didn’t have to reinsert their test data every time we flushed something from a table. Read More »