Showing posts with label dev. Show all posts
Showing posts with label dev. Show all posts

January 17, 2011

note to self: get maven nature on projects in (my)eclipse

myeclipse: v8.6
plugins/ software:
mavensupport for myeclipse (m4e)
maven integration for eclipse (m2)

now, if a project wasn't "maven-enabled", i often had to manually edit the .project file to make it so, even with mavensupport installed.

but if you also install "maven integration for eclipse", you can right-click a project without maven nature and select "(m2) myeclipse maven -> enable dependency management".

a last piece of the puzzle seems to be needed - i think i enabled some advanced option in m4e (might even have been seemingly unrelated, like advanced tabs in pom).  but a coworker disabled m4e after installing m2 and then got the right-click option to enable maven for a project...

edit: it seems i only had to enter the maven settings (myeclipse -> maven), and then exit (apply).  without changing anything... then the "(m2) myeclipse maven -> enable dependency management" option emerged...

September 4, 2010

Script Junkie | How to Debug Your jQuery Code

  • Firebug—Although many developers have used Firebug, I don't think that many understand the true potential of its debugging capabilities. If you know your tools inside out, you can become a more productive and efficient programmer. Note: If you aren't using Firefox, the Firebug Lite bookmarklet can come in handy to provide many of the nice debugging features of its Firefox add-on counterpart. I tend to use this bookmarklet primarily with Google Chrome.
  • FireQuery—This Firefox Firebug add-on provides some nice features to Firebug, such as letting you see which jQuery events are attached to what DOM elements, displaying any data elements that are attached to a DOM element, and providing the ability to inject jQuery into Web pages that don't have it already loaded.
  • FireFinder—This Firefox Firebug add-on can help you find the selector you are looking for. You can test the selector you have, and it will highlight all those items on your Web page.
todo: checkout firequery, firefinder...

Defect Driven Testing: Your Ticket Out the Door at Five O'Clock

are you not doing TDD yet? start with DDT...

Defect Driven Testing: Your Ticket Out the Door at Five O'Clock:
Test automation is not a controversial topic in most circles. Even developers who don't write automated tests agree it's a great idea. They just don't have time to work on it very often.
....
DDT is a fairly simple concept. When you find a bug, add a test.

Why take this approach?

First, no one can dispute the need for the test. If an issue was found, then it had been missed earlier. Perhaps the developer missed it and QA spotted it. Maybe it slipped past everyone and it was reported by your customer. Whenever it's reported, it needs to be fixed in a way that will prevent it from reappearing.
....
DDT is a gradual approach.
....
Over time you'll find that DDT creates an extremely effective test suite that targets the most problematic parts of your code base. Run your defect driven tests inside of a continuous integration system and you'll find your code running more cleanly every day.

August 27, 2010

tapestry 5 custom validation error message

in our system/ configuration, in order to customize T5 validation messages using the T5 validation message language key conventions, i had to use the following language keys:
  • "required" as language key for a required field
    - f.ex. when i use t:validate="required" in a .tml file
  • "number-format-exception" for a number field, and integer-format-exception for an integer field
    - when an input field attached to an integer property gets a letter, f.ex. 
using "%s" in the language expression will give access to the name of the field, f.ex. having an error message like "%s must be completed".
    what did NOT work for us, even if it worked for others (ref information below), was any prefix with field or form name, or a postfix of -message...


    Apache Tapestry - Form Input and Validation:
    Customizing Validation Messages

    Each validator (such as "required" or "minlength") has a default message used (on the client side and the server side) when the constraint is violated; that is, when the user input is not valid.

    The message can be customized by adding an entry to the page's message catalog (or the containing component's message catalog). As with any localized property, this can also go into the application's message catalog.

    The first key checked is formId-fieldId-validatorName-message.
    • formId: the local component id of the Form component
    • fieldId: the local component id of the field (TextField, etc.)
    • validatorName: the name of the validator, i.e., "required" or "minlength"
    If there is not message for that key, a second check is made, for fieldId-validatorName-message.

    If that does not match a message, then the built-in default validation message is used.

    http://tapestry.1045711.n5.nabble.com/T5-Overriding-integer-validation-message-td2436931.html#a2436931:

    (from the answers)

    You should add a prefix consisting of the field id (and optionally the form 
    id).
    (Igor)

    To generalize messages overrides for all form, you can contribute to ValidationMessagesSource service in your AppModule class with your own
    property file. (Christophe)

    Trial and error have yielded: [field id]-integer-message  (xfile80303)
    Blogged with the Flock Browser

    Dennis Stevens: We are Doing QA All Wrong

    A few interesting things from an article by Dennis Stevens, very loosely quoted...

    • We Don’t Understand Quality Assurance
    • We Don’t Understand the Cost of Rework
      • Rework from failed QA tests are extremely expensive to flow. Sending work back into development interrupts work in process. This has a dramatic effect on cycle time across the system – which results in increased cost of every item in the system.
    • the cost of setting up testing environments is much lower
    • Quality Assurance needs to be part of the development team and process. We need to change our thinking around this. So we need to integrate Quality Assurance very early in the process.
    • We have the Wrong Expectations
      • We Expect Perfection - Not Improved Value
      • We Expect Local Optimization - Not Flow
    • Enable value, flow, and ongoing improvement
    Dennis Stevens » Blog Archive » We are Doing QA All Wrong 

    From the comments:
    • One thing: No one can assure quality. Can I convince you to change the reference to “Quality Assistance?” (Jon Bach)
    • I prefer ‘testing’ and ‘tester’ to ‘quality assurance’ and ‘QA engineer’ or whatever. But these are nits. The message of Dennis’s post is the point – focus on value, improvement, delivering a better product. (Lisa Crispin)
    • I introduce myself to teams as the “public health nurse” for their project, and then subtly place ‘quality assistance’ in my email signature. (Adam Geras) 
    • testing is a complex, organic, cognitive activity, rather than a rote, bureaucratic, clerical one. (Michael Bolton)  

    Blogged with the Flock Browser

    May 26, 2010

    TDD w/javascript using jsTestDriver and (f.ex) QUnit

    JsTestDriver is seemingly yet another unit testing framework, and it stems from Google. I say seemingly, because the JsTestDriver guys has made some delicious improvements over the normal work flow which sets it apart from other unit testing frameworks for JavaScript so much it's not even funny to compare.

    Having said that, JsTestDriver is (as the name implies) really more of a test runner. It ships a default assertion framework, however it doesn't offer all kinds of JavaScript specific assertions. Instead, JsTestDriver makes it fairly accomplish-able to use your current assertion framework of choice with JsTestDriver by providing a bridge. Last time I checked, both QUnit and YUI Test had functional bridges.
    Test driven JavaScript done right / JavaScript - cjohansen.no

    There's also an eclipse plugin.

     ff
    Blogged with the Flock Browser

    February 23, 2010

    so you haven't seen complaints about maven?

    have you only heard good things?  i'm surprised...

    here's some stuff to balance it out.

    first, a couple of common complaints:
    • too complex
    • too rigid
    • too buggy
    • too opaque
    • difficult and time-consuming to debug problems
    then, a couple of links:
    Howard @ tapestry, maven vs ivy
    a collection of links on negative maven experiences


    January 31, 2010

    interface code smells

    Interfaces are a very useful language feature, but are much abused. Symptoms include:
    1. An interface is only implemented by one class
    2. A class implements multiple interfaces. Often touted as an advantage of interfaces, usually it means that the class in question is violating the principle of separation of concerns.
    3. There is an inheritance hierarchy of interfaces (often mirrored by a hierarchy of classes). This is the situation you're trying to avoid by using interfaces in the first place. Too much inheritance is a bad thing, both for classes and interfaces.
    All these things are code smells, IMO.
    (Jim Cooper)
    Why do most system architects insist on first coding to an interface? - Stack Overflow
    Blogged with the Flock Browser

    January 27, 2010

    building from scratch is mind-bogglingly easy compared to changing something

    Building something with a single purpose from scratch is mind-bogglingly easy compared to changing something that already exists. 
    ....
    The real cost of complexity increases exponentially.
    ....
    One guy wrote eBay in a day -- one guy, one day! When they built version 2, the project took the same guy many weeks. Version 3 took many years. There can never be a version 4
    ....
    why does each version take longer -- even if replacing the system in full? The answer is that small amounts of increases in perceived complexity (e.g. each new requirement) expands the real complexity of the system exponentially. Want examples? Take a hand-built web-site and add internationalization / localization. Add accessibility support. Add support for other devices, such as an iPhone. Add scale-out. Add high availability. Add security. If you know someone that thinks it's easy, then whatever you do, don't hire that person, fire them if they already work for you, and quit if you work for them.
    /dev/null : Weblog
    Blogged with the Flock Browser

    JsUnit - unit testing javascript

    JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript.

    JsUnit
    Blogged with the Flock Browser

    January 18, 2010

    powermock

    PowerMock is a framework that extend other mock libraries
    ....
    By using a custom classloader no changes need to be done to the IDE or continuous integration servers which simplifies adoption.
    ....
    PowerMock aims to extend the existing API's with a small number of methods and annotations to enable the extra features. Currently PowerMock supports EasyMock and Mockito.
    powermock - Project Hosting on Google Code
    Blogged with the Flock Browser

    November 19, 2009

    exception handling, bug reporting

    Then when an error occurs, try to only ask the user questions you can't answer programatically. Ideally, your exception handling should already track their current action (saving an invoice), current context (invoice screen), the entity being acted upon(invoice #10013), and all the exception info from the program. If you can't capture this and retrieve it remotely, feed it to your web form (in URL params or whatever) when the user clicks 'report this issue'. Ensure you pay attention to any sensitive data requirements.

    Then you should only need to ask your users the human questions like - 'How can we best contact you about this issue?' (method / times / etc.), and give them an idea of how long it'll take for them to get a response from a human.
    What is the best way to cater for users reporting bugs ? - Stack Overflow
    Blogged with the Flock Browser

    September 7, 2009

    JavaRebel - cut dev time

    JavaRebel is a JVM plugin (-javaagent) that enables you to see changes to your code immediately, without the need to redeploy an application or perform a container restart. It saves 5-10 minutes out of each hour of coding - one redeploy at a time.
    JavaRebel | ZeroTurnaround.com
    Blogged with the Flock Browser

    August 25, 2009

    ServiceMix Enterprise Service Bus...

    Apache ServiceMix is an open source ESB (Enterprise Service Bus) that combines the functionality of a Service Oriented Architecture (SOA) and an Event Driven Architecture (EDA) to create an agile, enterprise ESB.

    Apache ServiceMix is an open source distributed ESB built from the ground up on the Java Business Integration (JBI) specification JSR 208 and released under the Apache license. The goal of JBI is to allow components and services to be integrated in a vendor independent way, allowing users and vendors to plug and play.
    ....
    ServiceMix is lightweight and easily embeddable, has integrated Spring support and can be run at the edge of the network (inside a client or server), as a standalone ESB provider or as a service within another ESB. You can use ServiceMix in Java SE or a Java EE application server.
    ....
    ServiceMix is .... integrated with include JBoss [, ] .... provides an implementation of WS Notification [and] .... includes many JBI components including HTTP, JMS, BPEL, Rules, and many more ...
    Apache ServiceMix, the Agile Open Source ESB -- Home

    Blogged with the Flock Browser

    Integrating EJB 3 and Spring

    EJB 3 and Spring are often cast as contenders. However there are a growing number of applications that combine the strengths of both these technologies to create compelling best-of-breed solutions.

    This session is an introduction to creating powerful hybrid solutions with EJB 3 and Spring. It outlines some of the use cases where such integration makes sense and demonstrates how to inject Spring beans into EJB, ... as well as inject Session beans into Spring beans.
    ....
    Attend and learn how to tightly integrate Spring and Java EE 5 to utilize EJB 3 features, such as:
    • Minimal configuration;
    • 100% annotations;
    • Distributed transactions;
    • JAAS security;
    • Seamless JPA EntityManager/EntityManagerFactory injection,
    • Statefulness;
    • Passivation.
    TheServerSide Java Symposium - Language
    Blogged with the Flock Browser

    July 17, 2009

    get ms ie to handle standards?

    IE7 is a JavaScript library to make MSIE behave like a standards-compliant browser. It fixes many CSS issues
    /IE7/
    Blogged with the Flock Browser

    July 6, 2009

    questions for daily stand-up

    this is from a pdf on a different topic entirely (PDF: Dr Holt's CCPM Games - Sixes Game), but in the middle (p.8) is a few questions that could be used for a quick daily stand-up:
    1. Did you complete the Active Task Yet?
    If not: 2. How Much Time is Remaining?
    If not: 3. What are you awaiting?
    If not: 4. What can we do to help you?
    no. 1 and 2 is in effect info om MIT(s), the Most Important Task(s).
    no. 3 and 4 is in reality info on what i call BPP (SPP in Norwegian): Biggest Potential Problem.

    this could also be used along with a kanban board, especially if you limit yourself to only one Active Task most of the time.

    positive effects of asking/ providing this daily:
    • people will recognize the urgency of completing tasks
    • people will disconnect the due date from the actual completion of the task
    • giving time remaining leads to a better daily view of actual project buffer status
    • having a list of BPPs/ "what's holding up our process" is extremely valuable for process improvement and planning
    • "how can i help" may actually provide help to lingering tasks
    NB: ask the 4 questions daily, without much discussion, without penalty, with assistance as needed

    July 1, 2009

    rapid, "throw-away" prototyping is the crucial and neglected stage in project design

    a problem I think is endemic in the industry these days [is] the inability or unwillingness to engage in rapid prototyping. Every successful project I've ever worked on (and I've worked on some fairly large enterprise-sized projects), we started by designing and coding a quick "throw-away" skeleton of the application, that let us look at how the thing worked, where the unseen warts were, and where the vendors had lied about their APIs, etc. This is the crucial and neglected stage in project design, one that most modern design paradigms ignore or actively discourage.
    The Hacker Ethic - Harming Developers? - O'Reilly Radar
    Blogged with the Flock Browser

    June 16, 2009