Simple shear of a constrained strip is analyzed using discrete dislocation plasticity and strain gradient crystal plasticity theory. Both single slip and symmetric double slip are considered. The loading is such that for a local continuum description of plastic flow the deformation state is one of homogeneous shear. In the discrete dislocation formulation the dislocations are all of edge character and are modeled as line singularities in an elastic material. Dislocation nucleation, the lattice resistance to dislocation motion and dislocation annihilation are incorporated into the formulation through a set of constitutive rules. A complementary solution that enforces the boundary conditions is obtained via the finite element method. The discrete dislocation solutions give rise to boundary layers in the deformation field and in the dislocation distributions. The back-extrapolated flow strength for symmetric double slip increases with decreasing strip thickness, so that a size effect is observed. The strain gradient plasticity theory used here is also found to predict a boundary layer and a size effect. Nonlocal material parameters can be chosen to fit some, but not all, of the features of the discrete dislocation results. Additional physical insight into the slip distribution across the strip is provided by simple models for an array of mode II cracks.