Mini SQL Query - Version 1 Preview Release

by Paul 6/16/2008 2:57:00 AM

This is a "Preview release" of Mini SQL Query prior to version 1.0. It includes all updates since the "final beta" release. The main thing left to do is actually add this code to the CodePlex repository. I am looking at using SVN Bridge for that. For now get the source code from the ZIP distributions on CodePlex...

Modified app to use Castle Windsor for dependency injection

The core interfaces used by the application are now created via the Windsor container.  If you are not familiar with this library become so! It is extremely useful. The configuration of components has also been externalized in the "Configuration.xml" file – this make enhancements extremely flexible.
I have not as yet abstracted the schema engine which I would like to do so that it is easily swapped out (the current implementation is pretty basic but very generic!)

General refactoring around core interfaces

I have done a fair bit of tweaking and renaming. Some interfaces have had base interfaces abstracted to increase reusability.

Added allot of hopefully useful commenting

That pretty much says it all – the one thing I would like to see is more “example” code but the source is there so I am not worried.

Implemented simple text searching abilities

This is one of the main things I felt the tool was missing. It's just a basic looping find but it suits me. I have not added "replace" functionality yet but you can achieve this by hitting F3 and “pasting” your replace text! I class that as agile/YAGNI ;-)

Added a "search tools" plug-in under the SDK as an example and find implementation

The search provider and “go to line” implementation were created off the plug-in template as an example and included into the core distribution.

Enhanced the connection strings editor to make use of the providers connection string builder

This was added soon after the final beta release and since then tweaked. It makes use of the connection string builder class provided by each database provider which worked out really well just with the property grid. If the provider does not have an implementation a very generic class is used.

More to do?

The only remaining things that I would really like to see are the display of SQL messages – these are different for each provider so it's just a time thing – not hard at all.
The editor itself does not support batching, e.g. the "GO" syntax. It just means a few changes around the execution of the query and collection of results.
A plain text view of the results would be nice. Currently it's standard data grid only – just the "out of the box" data grid rendering of a dataset.

Go get it - http://www.codeplex.com/MiniSqlQuery/Release/ProjectReleases.aspx?ReleaseId=14424

PK :-)

 

Mini SQL Query Connection String Manager Patch

by Paul 5/26/2008 6:03:00 PM

Because it was one of the most requested missing features I put together an enhancement to the (very simple) connection string manager form.

It makes use of the db providers "connection string builder" (if implemented) and gives you a very functional property window to work with:

To edit a line put the cursor on it, to add a new one put the cursor on a blank line...

You can apply the pach by replacing the DLL - see the release on codeplex - http://www.codeplex.com/MiniSqlQuery/Release/ProjectReleases.aspx?ReleaseId=13772

The source is there too if you are playing around with it allready...

PK  :-)

 

Mini SQL Query has gone Open Source

by Paul 5/23/2008 6:24:00 AM

Just getting organised but see:

  http://www.codeplex.com/MiniSqlQuery

The "final beta" release is here:

  http://www.codeplex.com/MiniSqlQuery/Release/ProjectReleases.aspx?ReleaseId=13684

I have some more cleaning up to do but next week should be release v1.0  :-)

--- 

I spent some time cleaning the code up etc and making it more of an open source project (than a personal tools one). Note that the format of the connection file has changed...

The Source

Note that the source code requires .net 3.5 for building etc but the core components of tool itself targets .net v2. This is mainly so that within the tests etc you can take advantage of the latest language features (and libraries such as *MoQ*). Note also that there is nothing stoping you from creating plugins that target .net v3.5 - the user simply needs the runtime installed.

The SDK and Plug-Ins

See my blog for some posts about the tool - http://www.pksoftware.net/devblog/category/Mini-SQL-Query.aspx.

See http://www.pksoftware.net/devblog/page/Creating-a-Mini-SQL-Plugin.aspx for plugin creation details for now.

If you have suggestions etc please make them. I still need to upload the source code properly... see the ZIP on CodePlex for now (requires VS.NET 2008 express or greater, also works with SharpDevelop v3).

 

The bigger picture of application development

by Paul 3/30/2008 11:31:00 PM

Last week I posted some notes of an Acceptance Testing Framework I started developing. My motivation for this is part of a larger project that is an attempt to "integrate" the typically disparate pieces of a project, things such as requirements, tests and issue tracking.

I find many companies use different tools/systems (I am counting a simple document as a "system" here, e.g. a requirements doc) for each part of the process and there is allot of duplication and converting going on. This in my eyes is a big waste of time and effort.  I am a huge fan of keeping things DRY (Don't Repeat Yourself), applying this to the full SDLC is difficult but I think possible and definitely beneficial. I see allot of importing, exporting, synchronisation and maintenance of data between these systems, even if just a document is used to produce requirements there is still allot of duplication and effort required by the developers for example to keep things in sync (for both the tests and the implementation).

Another area that bugs me is test data. A useful requirements document (I find) contains examples of what its explaining, so why not have an appendix of acceptance tests (or references to test data files)? These tests can be pushed through a testing engine of some sort and complete that difficult customer-developer loop. If a manager (or even a customer) is after a progress update, use the acceptance test results to give a real indicator instead of sitting in a meeting for 2 hours pouring over a Gantt chart making educated guesses.

Instead of a big word processing document why not access requirements via a system that allows you to see the history (diff) on a particular requirement, or link to its defects, or view pending change requests? Developers can book their development time against items that are linked to requirements - the implementation of 1 requirement can span many layers etc. Developers can make attach notes to requirements and tests.

As far as integration of existing systems is concerned, how about each area - requirement, test, timesheet - is accessed through a basic pluggable component. If the company has a bug tracking system already they can create an adapter that provides access to the data (I am thinking a simple CRUD interface), this would allow communication between existing systems.

And what about help documentation, screenshots of those screens!?

Just some thoughts ;-)

Acceptance Test Framework

by Paul 3/27/2008 6:40:00 AM

I have started work on an acceptance test framework with concepts similar to FIT. Actually the acceptance testing is just part of a bigger picture that I am building up. I have a very integrated vision for requirements, their tests, code generation etc. I have not been able to get customers using systems like FIT, I think they find it too academic or something but would rather stick with the traditional methods that (seem) to work. Perhaps tolerate is a better word!

The acceptance tests for now are in the form of business rules as data in a spreadsheet, such as:

Pay Type  Amount  Overtime Hours  Result
Hourly    25.85   1               1056.00
Hourly    10      0               400.00
Daily     500     0               2500.00

The developers provide a “test view” that takes the data and processes it, the “Result” is then compared and a report produced. Business rules are extracted and documented as you work through examples. The acceptance tests then become regression tests to ensure no existing functionality is broken by further development.

public class PayCalcTestView : ITestView
{     
	private PayCalc _calculator;
	public int Overtime_Hours;
	public PayType Pay_Type;
	[AcceptanceTestOutput]public decimal Result;    
	public PayCalcTestView()
	{
		_calculator = new PayCalc();
	}
	public void ExecuteTest()
	{
		Result = _calculator.CalculatePay(Pay_Type, Amount);
	}
}

You can use fields or properties and an output variable (the one used for camparison) is marked with an attribute.

I am also looking at applying it to simple GUI testing for Windows Forms apps and possibly web sites.

It's the kind of project I would like to full time on for a couple f months!

 

Finally imported my old blog posts!

by Paul 3/25/2008 5:25:00 AM

I had trouble getting the Import tool to work so quickly rolled my own quick hack. It got most of it done - just a little cleaning left to do (the uploaded files/pics).

I'll post the code when I am done - nothing special but may prove helpful  ;)

 

An NUnitForms testing strategy

by Paul 3/12/2008 9:27:00 PM

These are basically some notes about to a GUI testing strategy I have adopted over the last year or so with NUnitForms. I am not going into what NUnitForms are etc here (because there an old NUnitForms post here) so I am assuming that you have at least some (or willing to get some) experience with the open source library prior to reading this post.

For a basic test fixture, typically you will inherit from the NUnitFormTest class overriding the Setup method:

[TestFixture]
public class FormXyzTests : NUnitFormTest{ 
 public override void Setup() 
 {
  new VesselDetailForm().Show();
  Application.DoEvents();
 }
 [Test] 
 public void CheckBla()
 {
  ButtonTester goButton = new ButtonTester("btnGo");
  LabelTester statusLabel = new LabelTester("btnGo");
  goButton.Click();
  Assert.That(statusLabel.Text, Is.EqualTo("Done."));
 }
}

When you test a button click you create a ButtonTester and initiate the Click method perform asserts and go home happy that your GUI is in a working state.

In the interests of refactoring GUI test that can quickly get bloated if you are not careful, I have ended up creating “form testers” that are in turn inherited by the test fixture. The form tester sets up a particular “scenario” and provides control testers and other helper methods through properties, for example:

public class FormXyzTester : NUnitFormTest
{
 public override void Setup()
 {
  VesselDetailForm frm = new VesselDetailForm();
  frm.Show();
  Application.DoEvents();
 }
 public ButtonTester GoButton
 {
  get { return new ButtonTester("btnGo"); } 
 }
 public LabelTester StatusLabel
 {
  get { return new LabelTester("lblStatus"); }
 }
}
 

Now the fixture inherits from the form tester and the tests are more readable.

[TestFixture]
public class FormXyzTests2 : FormXyzTester
{
 [Test]
 public void CheckBla()
 {
  GoButton.Click();
  Assert.That(StatusLabel.Text, Is.EqualTo("Done."));
 }
}

As other form specific related test helpers are required I add them to this base class. If needed, I also split this further with another base form tester class with common functionality. Other things I have included in these form testers are the message box responders, logging, even reporting and facilities to take screen shots of the application as its testing. These all help make for some very robust GUI testing classes.

PK Smile

 

Mini SQL Query and an SDK

by Paul 3/11/2008 5:58:00 AM

OK, I'll call it an SDK but for now it's just the query tool and ZIP file with the API help and a plugin project template for VS.NET 2008. I am also working on a tutorial page for making a plugin.

Mini SQL Query is at version 0.9.48 now (added some plugin base class helper stuff) and getting pretty close to a version 1 release. I have been getting good feedback and have a few things left to improve before I am happy to call this thing "version 1".

Slight upgrade to Mini SQL Query

by Paul 3/3/2008 9:30:11 PM

Last week I slipped an update in to Mini SQL Query - version 0.9.37.
Just minor fixes, updates, a quick start help page and I added a "Templates" tool window plugin...

Beta Release of Mini SQL Query

by Paul 2/21/2008 4:15:00 AM

Mini SQL Query is one of those tools that I have had in my self coded toolbox for a long time now. Last year I almost released it to the public but a few things happened and the release sadly didn't. My apologies to those that were waiting, I had plenty of emails in the months to follow asking where the editor was!

Well, I finally uploaded the beta - see http://www.pksoftware.net/MiniSqlQuery/


Mini SQL Query hitting an MSSQL database.

Make sure you register so that when fixes or major releases are made you know – there is also the Mini SQL Query product RSS feed). Keep in mind its in no way intended as a replacement for Microsoft's "SQL Server Management Studio". I use it for making quick queries or updates to my databases. I find it particularly good for managing a remotely hosted database. I don't use it for modeling databases etc but I do plan on making a bunch of plugins to help with quickly putting together a NetTiers focused database model.


Mini SQL Query hitting an MS Access database with a table window floating.

The application itself it an exercise in minimalist coding. I made use of open source libraries such as the ICSharpTextEditor giving lots of edit functionality with little effort. I used Weifen Luo’s docking library which has been great (I need to track down the correct links etc will post later). The design employs a service model with commands which keeps code nicely separated and easily extendable (see the API docs on making plugins if you have the geekish urge to, there is also a tutorial on creating plugins now too). The testing is done with a combination of stubs and mocks (I use Rhino Mocks, just love the style...)

The whole application was actually coded with Microsoft Visual C# Express Edition. I wanted to see what a hobby developer IDE could come up with. What did I miss most? Addins like testdriven.net and resharper!

 

Some notes...

Multiple Connection Types

One of the main features is the fact that you can connect to pretty much any database so long as you know the Provider type and connection string. I have only had MSSQL and Access databases to test against so far but I might try and ressurect my Oracle instance just to check out the schema details.

Probaby the main usability thing to keep in mind is that if you change the provider type and/or the connection string you should hit the 'Refresh Database Connection' button/menu item. The 'Database Inspector' gets reloaded at this point too.

Database Inspector

The inspector window shows basic details that are taken from the DBConnection.GetSchema output. I have noticed that some of the types for the access databases are not actually defined and so come though as a number with a question mark (e.g. 130? with is actually a variable string) .

Settings Persistance

There is none yet! I have not worried about it to date but that will turn up in time.

 

Let me know what you think, PK  :-)

 

Powered by BlogEngine.NET 1.3.1.0
Theme by Mads Kristensen

About the author

Paul Kohler Paul Kohler
A .NET software developer living and working in Brisbane, Australia.

PK Software
E-mail me Send mail

Calendar

<<  July 2008  >>
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

View posts in large calendar

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008