Thursday, February 07, 2008

Test Automation with FireFox Add On

I have been using iMacros Firefox Add On
to help automate my testing through the web.

The art of software testing

In the introduction to the book "The art of software testing" it poses a simple program and ask how many test cases you can think of...

"The program reads three integer values from an input dialog. The three values represent the lengths of the sides of a triangle. The program displays a message that states whether the triangle is scalene, isosceles, or equilateral."

If you write down all the test cases you can think of, you will most likely be surprised how many things you don't think of. (they provide a list of test cases in the link)

Tuesday, February 05, 2008

Testing a web site before you migrate the DNS

When you set up a web site on a new domain an easy way to test it out before migrating the dns is to add a record to the host file on your local machine, and override dns to get to the new ip address.

here is a command from windows system that will open host file on any windows os
notepad %systemroot%\system32\drivers\etc\hosts

or on unix
vi /etc/hosts

then add the record (be sure to put a tab between your ip and the domain
70.170.170.170 my.domain.com

Be sure to remove the entry when you migrate the DNS. Also before migrating DNS records be sure to lower the TTL to 5 minutes for at least 48 hours before you make the change.

Sunday, February 03, 2008

windows service problem

I have been having a problem for weeks with a windows service that sporadically quit working. Fortunately, it never happened in the production environments. It only happened on my dev box. Tonight I finally figured it out.

The first thing the service does is log a message to indicate it started. It is also in a try/catch that logs exceptions to the event viewer. Turns out the event viewer had reached it's maximum size, so it would quit working and there would be no indication of the problem in the event viewer, because it was the problem.

I ended up changing an option to "Overwrite events as needed" from "Overwrite events older than 7 days." The production server was already set to overwrite as needed, which explains why it worked in production, but sporadically failed in dev.


Tuesday, January 29, 2008

.Net Pop3 library

It's always seemed strange to me that .Net doesn't have pop3 capabilities built into the framework.


Here is an open source pop3 library for .Net. http://sourceforge.net/projects/hpop/

Monday, January 28, 2008

Steve Jobs' Stanford graduation speech

This is one of my favorite inspirational pieces about life and business. I especially like the parts about finding what you love to do and connecting the dots.

SEO Basics

seo (search engine optimization) is the how to get your web pages ranked well on search engines like google. According to google there are 100s of factors that determine your rank on a search. If you are running a site these considerations should be secondary to the basic design and functionality of your web site. However more often than not, these ideas are consistent with a well designed, functional site.


Basics

1) Submit your site to google.


2) Read google's webmaster information
including guidelines,
and faq.

3) Validate your html. If your html is bad spiders can't distinguish between
visible text, structural tags, etc.

http://validator.w3.org/

Some suggest making it html 3.2 compliant


4) Make sure your links work. Links are the primary way google finds pages.


5) Use a reliable web host. Google can't index your site if it is down.



Serp basics (serp - Search Engines Results Page)

6) Raise your PageRank by getting links from on-topic sites. (See tip 16)

Submit your site to the open directory project
under an appropriate section.

Submit to yahoo or Looksmart
directory if you have the cash (or you run a not for profit site)

Swap Links with other related sites.

The page rank of the actual linking page is a key factor, not the pagerank
of the site root.

Make sure sites that link use normal links, not javascript (what about redirects?)

interlink your pages.

make sure all pages have link back to home page.

google looks at individual page independently, not at sites, so links from your own site help you.

make it easy to get to all your pages in minimum number of clicks.

make sure you use normal html links to interlink your pages. google probably won't figure out drop downs with javascript, etc. to spider your site.

use a site map.

7) Choose the keywords you are targeting carefully.

you need to know your market to choose keywords

for instance if you are selling a product, don't make "free" a keyword, or
you are unlikely to convert your traffic.

8) Keyword density is a key factor. Put your keywords in your title, meta tags (keyword and description), visible text (in bold/in H1 tags), in the url, etc.

there are tools like keyworddensity.com
that tell you the percentage for your keywords.

the best percentages are debatable, and the best percentage should depend
on functionality of site and your competition. 2%-10% is ballpark.

9) put keywords in alt and title attributes on images.

10) make simple, small pages.

this will increase keyword density.

pages should probably only target at most three keywords.

Google will index a maximum of 101k of any page


11) Create lots of pages.

For instance, one for each item you are selling.


12) use keywords in links. (internal site links, and encourge people that link to you to do the same)

this raises kwd on page with link and associates linked page with the keywords
also.

use keywords in text links

put keywords in link's title attribute.


14) put links and keywords near the top of the page. also called KW prominence.
google regards stuff further down page as less important.



15) make relative links unless the full url contain keywords.

this advice is debatable.



Checking up on your site

16) Get the google toolbar so you can check page rank of your site, your competitors
and people you might swap links with.



17) Trick to check to see how many of your pages have been indexed. Do negative
search for a word that is not on your site.

-zaazaazing site:andrewontechnology.com



18) check to see what sites are linking to your site (often called backlinks)
by searching goole for link:mysite.com.

this generally only shows pages that link with a page rank of 4 or above.



19) check to see what sites link to your competitors or related pages and
try and get linked on those pages also.



20) don't use a tool like web position gold to check your site for you automatically.
it is a violation and google might punish you.



21) study your web server refer logs. this should show you how many hits you
are getting and what people are searching on.



Stuff to not do

22) don't use a virtual host.



23) dont' use frames. frames suck anyway:-) and google may have a hard time
with them.



24) don't use javascript links for pages that you want google to follow.

some people use javacscript links for pages that they don't want indexed.



25) don't put inline javascript or css... put javascript and css in external
files.

this is debatable if it helps. i guess it keeps the page small, doesn't mess
up kwd. it's just a good idea anyway.



26) don't use flash. google can't read it.


Debatable tactics

27) Tricks that might get your site indexed faster:

- the best way is to get links from other sites.

- put a link to your site in a blog post. google owns blogger and I suspect they use it to keep their links fresher than rivals.

- submitting individual pages.

- adding the google search to your page.

- using google adwords (openly adwords doesn't affect the google index)

28) Keyword proximity: Keyword proximity refers to the closeness between two
or more keywords. In general, the closer the keywords are, the better

29) Don't use black hat methods.

don't link to "link farms" or bad neighborhoods.

30) don't spam.

you can spam blogs, news groups, forums, wikis, and public site statistic pages.

this is very uncool, but it is unlikely that google will punish you because if they did, people could spam for their competitors to get them punished


31) Report competitors that outrank you that are using black hat methods.
(http://www.google.com/contact/spamreport.html)

Hidden text or links

what it is: text that can't be seen because it is nearly the same color as
the background.

links that are for a small image (1 pixel by 1 pixel)

how to detect it: select as much of the page as you can and text will show up.

Misleading or repeated words (often called stuffing)

Page does not match Google's description

Cloaked page

what it is: where a site has one page for googlebot, and another for users

how to detect it: cache is different from real page? program?

Deceptive redirects (when you go to page a meta refresh tag sends you to another
page)

Doorway pages (page is not to on any site. submitted directly to search engine?)

Duplicate site or pages (people copy other people's page to generate content)

Other (specify)



32) remove session id from url. this makes it hard for google to distinguish pages.

Also many people advise only one or fewer parameters be passed to program.

Some suggest using mod_rewrite to avoid passing parameters.

it is thought that google doesn't want to over burden your machine so it takes
time to build an index of dynamic pages.

33) be patient. it appears google may be using how long your pages have been
indexed as part of it's criteria. this may be because people are throwing
up sites to get pagerank, and when they get banned just opening a new one.
this makes it more difficult.


34) some sites say to have outbound links to on topic, high profile (i.e. high page rank) sites.

however this may leak your pagerank that you could pass to your own site.

it could be that the only benefit is you are just raising kwd.

google.com is ranked 10 with no outbound links, however, google itself, rarely shows up in search results unless you search for google.

some think that google likes sites that link to google.

35) use robots.txt and/or meta tag to remove pages that are not good pages
to index. these pages leak pagrank.

for instance I have a login page, and every page links to it near the top of the page.

36) some people think putting all you pages in the root directory helps them.

not sure about that one.

commonly accepted that having directories more than 4 or 5 deep will cause
problems.


37) domain spamming is creating lots of domains with virtually the same content
so you get all the top listings.

the content can't be exactly the same because of duplicate site penalty. some suggest 15% variance.

GAC GUI

cool tool for managing the .Net Global Assembly cache.

Think twice before using 64 bit OS

I don't recomend 64 bit Version of Windows Server 2003. The only exception is a box dedicated to an application that has good support. For instance, it would make sense to have a SQL server box that runs 64 bit version of Windows Server 2003, but a web server that may need to use third party libraries should probably run on a 32 bit version. As the links illustrate, often old driver and 3rd party applications, just don't work. Error with ole db driver on 64 bit windows, and Error retrieving COM class

Monday, January 21, 2008

CPorts: Graphic netstat program for windows

CPorts is a slick tool that provides an GUI for the netstat command.