#Dev Checklist
##Things to check before code is 'complete'
###Client-side
- Has javascript been unit tested?
- Test page in various browsers (support back to IE8) for UI bugs
- All html forms (think POST) should have
@Html.AntiForgeryToken()
- All form headers should be driven from
t_WebContent
- CSS should be in css file, not inline
- To add red asterisks to required fields use the required class on the containing div like the following (this utilises our .label-left.required:before pseudo selector):
<div class="label-left required">
@Html.LabelFor(m => m.FieldName)
</div>
- Submits that are expected to take time should display the spinning gif
- All fields should have
maxlength
applied (expecially those with Regex) - JavaScript should not subscribe to any events at a global level - should always be scoped to a function definition
- Test double-clicking of submit buttons
- Test page behaviour with slow sql server responses
- Check page against webdevchecklist.com (install chrome extension)
- Achieve good score in Google PageSpeed (install chrome extension)
- Achieve good score in Yahoo! YSlow (install chrome extension)
###Server-side
- Have unit tests been written?
- Code defensively -- assume all javascript logic/validation has been bypassed
- Code defensively -- use
FirstOrDefault
orSingleOrDefault()
and if null log it, then redirect instead of waiting for exception - All GET's that take parameters should cater for that parameter not being included
- All POST actions should be decorated with
[ValidateAntiForgeryToken]
- POST actions should use PRG pattern (like Report an Issue). See http://en.wikipedia.org/wiki/Post/Redirect/Get
- Methods should be small - refactor repeating code into methods
- All possible logic should be contained in Domain Logic class rather than controller
- Use
enum
instead of magic strings where possible - If can't use enums use const or readonly string variables
- Actions that require you to be logged in should be decorated with
[Authorize]
- Action that return JSON that require you to be logged in should be decorated with
[AjaxAuthorize]
- Check your local ELMAH log to see if your code is generating any errors that are being swallowed
- DB columns should have sensible column lengths & indexes specified
- Mitigate querystring tampering. If loading data based on a querystring parameter, ensure that the logged on user has is the owner of the the requested data
##WCAG
- Run the Squiz labs html code sniffer on each page and fix errors. http://squizlabs.github.io/HTML_CodeSniffer/ - copy bookmarklet to bookmark bar in Chrome
###Database
- All changes of database schemas are to be applied to database projects and and checked the in TFS
- All changes of database schemas are to be applied to relevant staging tables in external and internal databases
- All changes of database schemas are to be applied to OBC_MBC as well.
- Change of schemas normally indicates new records are to be added to
t_ads_dictionary
table and rebuild of view table in SQL server for datasync processing - A new baseline of every database schema is required for every release