Microfluidic technologies are popular for biological research, enabling precise physical and chemical control of the microenvironment surrounding living cells and small organisms. Caenorhabditis elegans, a 1 mm long nematode, is capable of olfactory associative learning using the classical conditioning paradigm of pairing an unconditioned stimulus that elicits an innate response, such as food, with a second stimulus, such as an odor, which then elicits a learned behavioral response to this conditioned stimulus alone. Conventional chemotaxis assays on agar petri-plates have been widely used to observe behavioral changes indicative of associative learning; however, reproducibility of these behavioral assays is a major challenge. Here, we describe a microfluidic system that improves the reproducibility of chemotactic behavioral assays by providing better spatiotemporal control of stimuli, gentler worm handling, and more detailed behavioral quantification. Specifically, the microfluidic designs in this study present a uniform conditioning environment followed by a temporally stable linear odor gradient to assess changes to olfactory preference. Stimuli are presented in an enclosed environment to multiple worm populations whose locomotory patterns are analyzed using machine vision. Furthermore, we established an optimized protocol for a positive associative learning paradigm in which animals increase their preference for an odorant, butanone, when previously paired with bacterial food. We reproduced plate-based learning results in wild-type and learning-deficient genetic mutant animals, and demonstrated how developmental stages and chemicals alter the plasticity of olfactory preference.