Computer Knowledge. Gadget. Anime. Design. Dance. Hong Kong Life. Stuff like that.

1.26.2009

Stuff I learned from TechFest 2009

I like to recap after attending a conference, a seminar, or whatever learning experience I've been through. So here's the recap of my TechFest 2009:

JQuery:
  • Home Page
  • Best way to debug JQuery: using Firebug
  • A great way to do Unobtrusive JavaScript
  • When design a page, try moving all JavaScript away from the page (move into an external file). This approach even helps performance (because of caching)
  • Beware of problem between ASP.Net Ajax and JQuery (more...). The problem seems to be on the dollar sign namespace. There are tricks to resolve the problem.
  • Someone used the "Noconflict()" call as work arourd but some said it doesn't work.
  • QUnit makes it possible to unit test JQuery.

New Features in C# 3.0

Mock and Stub
  • Difference between mock and stub
  • Need to define test in more specific way: automated test (may call db or external stuff), unit test (no external call), integration test (calls all the shit to get real world result)
  • We should strike for spending more time on Unit Test and less on integration test, cause Unit test is useless unless you got very fast feedback
  • Darker Color scheme may help your productivity. Here's some schemes to choose from for VS 2008. Here's a nice dark color scheme. And here's why it's good.
  • Speaker suggested Rhino Mocks
  • Rhino Mocks relies on the fact that object are all using an interface
  • When there's a block of logic you want to externalize, you can refactor that set of code into a class, with a correspsonding interface. And then for the constructor of the current code you require the interface being passed in in your constructor, but at the same time provide a default constructor that have the interface instance created for the user.
  • ShouldEqual seems more expressive than Assert, but it seems to be a Microsoft Visual Studio thing.
  • Speaker mentioned a book called "Legacy Cookbook". Could not find it, but I found this.
  • specification pattern : Class represent logic that return True or False
  • Assert method got called once only
  • Stub : provide predeginded return value
  • Spec.stub
  • Static class not friendly to mock
  • Try use generic mock, var, the C# 3.0 feature.

  • For void , Use assertWasCalled, like need to check to make sure it is being called
  • For others,(non void) predictable result, use stub

Static Test

Entity Framework

0 Comments:

Post a Comment

<< Home